:root{
  --bg:#f4f7fb;--panel:#fff;--text:#172033;--muted:#6b7485;--line:#e6eaf0;
  --primary:#2563eb;--primary2:#1d4ed8;--danger:#dc2626;--ok:#059669;--warn:#d97706;
  --shadow:0 10px 30px rgba(15,23,42,.07);--radius:16px
}
*{box-sizing:border-box}body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial;background:var(--bg);color:var(--text)}
button,input,select{font:inherit}.app{min-height:100vh;display:grid;grid-template-columns:238px 1fr}
.sidebar{background:#0b1220;color:#fff;padding:24px 16px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}
.brand{display:flex;gap:12px;align-items:center;padding:0 8px 25px}.brand-mark{width:48px;height:48px;border-radius:50%;background:#fff;display:grid;place-items:center;overflow:hidden;box-shadow:0 4px 14px rgba(0,0,0,.24)}.brand-mark img{width:100%;height:100%;object-fit:cover}.brand strong,.brand span{display:block}.brand span{font-size:12px;color:#8fa1bc;margin-top:3px}
nav{display:grid;gap:7px}.nav-btn{border:0;background:transparent;color:#aebbd0;padding:12px 14px;border-radius:10px;text-align:left;cursor:pointer;display:flex;gap:12px}.nav-btn:hover,.nav-btn.active{background:#17233a;color:#fff}.sidebar-foot{margin-top:auto;border-top:1px solid #23314a;padding:18px 10px 0}.sidebar-foot span,.sidebar-foot small{display:block}.sidebar-foot small{color:#8292ad;margin-top:4px}
main{padding:26px 30px 48px;min-width:0}.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px;gap:16px}.topbar h1{margin:0;font-size:28px}.topbar p{margin:5px 0 0;color:var(--muted)}.top-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
button,.file-label{border-radius:10px;padding:10px 14px;border:1px solid var(--line);cursor:pointer;background:#fff}.primary{background:var(--primary);color:#fff;border-color:var(--primary);font-weight:700}.primary:hover{background:var(--primary2)}.ghost{background:#fff;color:var(--text)}.wide{width:100%;padding:14px}.file-label input{display:none}
.view{display:none}.view.active{display:block}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:18px}.stat{background:var(--panel);border:1px solid var(--line);box-shadow:var(--shadow);border-radius:var(--radius);padding:18px}.stat span{font-size:13px;color:var(--muted)}.stat strong{display:block;font-size:25px;margin-top:8px}.stat small{color:var(--muted)}
.grid.two{display:grid;grid-template-columns:1.2fr .8fr;gap:18px}.card{background:var(--panel);border:1px solid var(--line);box-shadow:var(--shadow);border-radius:var(--radius);padding:20px}.card-head{display:flex;justify-content:space-between;gap:15px;align-items:center;margin-bottom:18px}.card-head h2{margin:0;font-size:18px}.card-head p{margin:5px 0 0;color:var(--muted);font-size:13px}
.pos-layout{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(340px,.75fr);gap:18px}.search{width:330px;max-width:45vw}.product-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.product-card{border:1px solid var(--line);border-radius:14px;padding:14px;cursor:pointer;transition:.18s;background:#fff}.product-card:hover{transform:translateY(-2px);box-shadow:var(--shadow);border-color:#b9cbfa}.product-card h3{font-size:15px;margin:8px 0 4px}.product-card p{font-size:12px;color:var(--muted);margin:0}.product-card .price{font-weight:800;color:var(--primary);margin-top:10px}.badge{display:inline-flex;padding:4px 8px;border-radius:999px;background:#eef4ff;color:#315ca8;font-size:11px}.badge.low{background:#fff1e7;color:#a9510a}.badge.ok{background:#e9fbf3;color:#067352}
.cart-card{position:sticky;top:20px;height:max-content}.field-row,.discount-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}.cart-items{margin:15px 0;max-height:330px;overflow:auto}.cart-item{padding:12px 0;border-bottom:1px solid var(--line)}.cart-item-top{display:flex;justify-content:space-between;gap:10px}.cart-item small{color:var(--muted)}.qty{display:flex;align-items:center;gap:8px;margin-top:8px}.qty button{padding:4px 9px}.remove{color:var(--danger);border:0;background:none;padding:0}.link-danger{border:0;background:none;color:var(--danger);padding:0}.totals{border-top:1px solid var(--line);padding:13px 0}.totals div{display:flex;justify-content:space-between;padding:5px 0}.totals .grand{font-size:19px;font-weight:800;border-top:1px dashed var(--line);margin-top:7px;padding-top:12px}
label{display:grid;gap:6px;font-size:13px;color:var(--muted)}input,select{border:1px solid #d9dee7;border-radius:9px;padding:10px;background:#fff;color:var(--text);width:100%}input:focus,select:focus{outline:2px solid #dbe7ff;border-color:#8aacf4}
.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%}th,td{text-align:left;padding:12px;border-bottom:1px solid var(--line);font-size:13px;white-space:nowrap}th{color:var(--muted);font-weight:600;background:#fafbfd}td strong{display:block}.muted{color:var(--muted)}.actions{display:flex;gap:6px}.actions button{padding:6px 9px}.empty{padding:30px;text-align:center;color:var(--muted)}
.list-row{display:flex;justify-content:space-between;gap:14px;padding:11px 0;border-bottom:1px solid var(--line)}.list-row:last-child{border:0}.list-row small{display:block;color:var(--muted);margin-top:3px}.money{font-weight:800}.negative{color:var(--danger)}
.modal{position:fixed;inset:0;background:rgba(2,6,23,.66);display:none;place-items:center;padding:20px;z-index:320}.modal.open{display:grid}.modal-box{background:#fff;border-radius:18px;width:min(680px,96vw);max-height:90vh;overflow:auto;box-shadow:0 20px 80px rgba(0,0,0,.25)}.modal-head{display:flex;justify-content:space-between;padding:18px 20px;border-bottom:1px solid var(--line)}.modal-head h2{margin:0}.modal-head button{border:0;font-size:24px;padding:0}.modal-body,.modal-box form{padding:20px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.form-grid button{grid-column:1/-1}.presentation-editor{border:1px solid var(--line);border-radius:12px;padding:12px;grid-column:1/-1}.presentation-row{display:grid;grid-template-columns:1.1fr .7fr .8fr auto;gap:8px;margin:8px 0}
.toast{position:fixed;right:24px;bottom:24px;background:#0f172a;color:white;padding:13px 18px;border-radius:10px;opacity:0;transform:translateY(12px);pointer-events:none;transition:.2s;z-index:50}.toast.show{opacity:1;transform:none}
@media(max-width:1000px){.app{grid-template-columns:78px 1fr}.brand div:last-child,.nav-btn span,.sidebar-foot{display:none}.brand{padding-left:0}.brand-mark{margin:auto}.nav-btn{justify-content:center;font-size:18px}.stats{grid-template-columns:1fr 1fr}.grid.two,.pos-layout{grid-template-columns:1fr}.cart-card{position:static}.product-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:640px){main{padding:18px 12px 90px}.app{display:block}.sidebar{position:fixed;z-index:20;bottom:0;top:auto;height:66px;width:100%;padding:8px;background:#0b1220}.brand,.sidebar-foot{display:none}nav{display:flex;justify-content:space-around}.nav-btn{padding:12px}.nav-btn:nth-child(n+6){display:none}.topbar{align-items:flex-start}.top-actions .ghost,.file-label{display:none}.stats{grid-template-columns:1fr 1fr;gap:10px}.stat{padding:14px}.stat strong{font-size:20px}.product-grid{grid-template-columns:1fr 1fr}.search{width:100%;max-width:none}.card-head{align-items:flex-start;flex-direction:column}.field-row,.discount-row,.form-grid{grid-template-columns:1fr}.presentation-row{grid-template-columns:1fr 1fr}.topbar h1{font-size:23px}}
@media print{body>*{display:none!important}#printArea{display:block!important}}

.system-footer{margin-top:24px;padding:14px 18px;text-align:center;color:var(--muted);font-size:12px;border-top:1px solid var(--line)}
.system-footer strong{color:var(--text)}

.receipt-preview{position:fixed;inset:0;background:rgba(2,6,23,.72);z-index:100;display:none;place-items:center;padding:14px}
.receipt-preview.open{display:grid}.receipt-preview-box{width:min(520px,100%);height:min(92vh,820px);background:#fff;border-radius:18px;display:grid;grid-template-rows:auto 1fr auto;overflow:hidden;box-shadow:0 25px 90px rgba(0,0,0,.35)}
.receipt-preview-head{display:flex;align-items:center;justify-content:space-between;padding:15px 18px;border-bottom:1px solid var(--line)}
.receipt-preview-head h2{font-size:18px;margin:0}.receipt-preview-head p{font-size:12px;color:var(--muted);margin:3px 0 0}.receipt-close{border:0;background:none;font-size:28px;padding:0 6px}
.receipt-preview-body{background:#e9edf3;padding:16px;overflow:auto;display:flex;justify-content:center}.receipt-preview-body iframe{width:80mm;min-height:650px;height:100%;background:#fff;border:0;box-shadow:0 4px 20px rgba(15,23,42,.16)}
.receipt-preview-actions{display:flex;justify-content:flex-end;gap:9px;padding:13px 16px;border-top:1px solid var(--line);background:#fff}
@media(max-width:640px){.receipt-preview{padding:0}.receipt-preview-box{height:100vh;width:100%;border-radius:0}.receipt-preview-body{padding:8px}.receipt-preview-actions{justify-content:stretch}.receipt-preview-actions button{flex:1;padding:11px 6px;font-size:12px}}

.payment-modal{position:fixed;inset:0;background:rgba(2,6,23,.6);display:none;place-items:center;padding:18px;z-index:80}
.payment-modal.open{display:grid}
.payment-box{width:min(430px,96vw);background:#fff;border-radius:18px;box-shadow:0 25px 80px rgba(0,0,0,.3);overflow:hidden}
.payment-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;padding:18px 20px;border-bottom:1px solid var(--line)}
.payment-head h2{margin:0;font-size:20px}.payment-head p{margin:4px 0 0;color:var(--muted);font-size:13px}
.payment-head button{border:0;background:transparent;font-size:26px;line-height:1;padding:0}
.payment-body{padding:20px;display:grid;gap:14px}
.payment-total,.change-box{display:flex;justify-content:space-between;align-items:center;border-radius:14px;padding:16px;background:#f6f8fc;border:1px solid var(--line)}
.payment-total span,.change-box span{color:var(--muted)}
.payment-total strong{font-size:26px;color:var(--primary)}
.change-box strong{font-size:24px;color:var(--ok)}
.quick-money{display:grid;grid-template-columns:repeat(5,1fr);gap:7px}
.quick-money button{padding:9px 4px;font-size:12px}
.payment-error{min-height:18px;color:var(--danger);font-size:13px;text-align:center}
.payment-actions{display:flex;justify-content:flex-end;gap:10px;padding:16px 20px;border-top:1px solid var(--line)}
@media(max-width:520px){.quick-money{grid-template-columns:repeat(3,1fr)}}


.dashboard-charts{margin-top:18px}
.bar-chart{display:grid;gap:12px;min-height:210px;align-content:center}
.bar-row{display:grid;grid-template-columns:92px 1fr 78px;gap:10px;align-items:center;font-size:12px}
.bar-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}
.bar-track{height:12px;background:#edf1f7;border-radius:999px;overflow:hidden}
.bar-fill{height:100%;background:linear-gradient(90deg,var(--primary),#22c55e);border-radius:999px;min-width:3px}
.bar-value{text-align:right;font-weight:800}
.compact-select{width:auto;min-width:150px}
.report-card{margin-top:18px}
.report-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.metric-positive{color:var(--ok)}
.metric-warning{color:var(--warn)}
.kardex-in{color:var(--ok);font-weight:800}
.kardex-out{color:var(--danger);font-weight:800}
.payment-progress{display:grid;gap:11px}
.payment-line{display:grid;grid-template-columns:100px 1fr 84px;gap:10px;align-items:center}
.payment-line .bar-track{height:10px}
@media(max-width:640px){
 .bar-row{grid-template-columns:72px 1fr 62px}
 .payment-line{grid-template-columns:76px 1fr 68px}
 .report-actions{width:100%}.compact-select{width:100%}
}


.purchase-box{width:min(880px,97vw)}
.purchase-form-grid{grid-template-columns:repeat(4,1fr)}
.purchase-item-editor{border:1px solid var(--line);border-radius:14px;padding:12px}
.purchase-item-controls{display:grid;grid-template-columns:1.4fr 1fr .6fr .8fr auto;gap:8px;align-items:end}
.purchase-item-row{display:grid;grid-template-columns:1.5fr .9fr .6fr .8fr .8fr auto;gap:8px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line);font-size:13px}
.purchase-item-row:last-child{border-bottom:0}
.purchase-item-row small{color:var(--muted)}
.payable-row{display:flex;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}
.payable-row:last-child{border-bottom:0}
.payable-row .actions{justify-content:flex-end}
@media(max-width:800px){
 .purchase-form-grid{grid-template-columns:1fr 1fr}
 .purchase-item-controls{grid-template-columns:1fr 1fr}
 .purchase-item-row{grid-template-columns:1fr 1fr}
}
@media(max-width:520px){
 .purchase-form-grid{grid-template-columns:1fr}
 .purchase-item-controls{grid-template-columns:1fr}
 .purchase-item-row{grid-template-columns:1fr}
}


.login-screen{position:fixed;inset:0;background:linear-gradient(135deg,#07111f,#17233a 55%,#1d4ed8);display:grid;place-items:center;padding:20px;z-index:200}
.login-screen.hidden{display:none}
.login-card{width:min(420px,96vw);background:#fff;border-radius:22px;box-shadow:0 30px 100px rgba(0,0,0,.35);padding:28px}
.login-brand{display:flex;gap:14px;align-items:center;margin-bottom:24px}
.login-logo{width:58px;height:58px;border-radius:16px;background:linear-gradient(135deg,#2563eb,#22c55e);color:#fff;display:grid;place-items:center;font-size:22px;font-weight:900}
.login-brand h1{margin:0;font-size:27px}.login-brand p{margin:4px 0 0;color:var(--muted)}
.login-card form{display:grid;gap:15px}
.password-wrap{display:grid;grid-template-columns:1fr auto;gap:8px}
.password-wrap button{padding:9px 12px}
.login-error{min-height:18px;color:var(--danger);font-size:13px;text-align:center}
.login-help{margin-top:18px;padding:13px;border-radius:12px;background:#f6f8fc;border:1px solid var(--line);display:grid;gap:4px;font-size:12px;color:var(--muted)}
.login-help strong{color:var(--text)}
.login-footer{text-align:center;color:var(--muted);font-size:12px;margin-top:18px;line-height:1.5}
.session-user{display:grid;text-align:right;line-height:1.1}
.session-user span{font-weight:800;font-size:13px}.session-user small{color:var(--muted);font-size:11px}
.user-status{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:11px}
.user-status.active{background:#e9fbf3;color:#067352}.user-status.inactive{background:#feecec;color:#9f1d1d}
@media(max-width:640px){.session-user{display:none}#logoutBtn{padding:9px 10px}}


.admin-users-shortcut{display:inline-flex}
.mobile-users-btn{display:none;position:fixed;right:16px;bottom:82px;width:52px;height:52px;border-radius:50%;border:0;background:var(--primary);color:#fff;font-size:22px;box-shadow:0 10px 28px rgba(37,99,235,.35);z-index:60}
@media(max-width:640px){
 .sidebar nav{overflow-x:auto;justify-content:flex-start;gap:6px;padding:0 4px;scrollbar-width:none}
 .sidebar nav::-webkit-scrollbar{display:none}
 .nav-btn{flex:0 0 52px}
 .nav-btn:nth-child(n){display:flex}
 .admin-users-shortcut{display:none}
 .mobile-users-btn{display:grid;place-items:center}
}


.receipt-preview-actions{flex-wrap:wrap}
@media(max-width:520px){.receipt-preview-actions button{flex:1 1 140px}}

.cloud-status{padding:6px 9px;border-radius:999px;font-size:11px;font-weight:800;white-space:nowrap}
.cloud-status.online{background:#e8fbf2;color:#067352}
.cloud-status.syncing{background:#fff4df;color:#a9510a}
.cloud-status.offline{background:#feecec;color:#9f1d1d}
@media(max-width:640px){.cloud-status{position:fixed;top:8px;right:8px;z-index:90}}

#modal{z-index:320!important}
#modal .modal-box{position:relative;z-index:321}
.login-screen{z-index:200}

.sale-cancelled{opacity:.72;background:#fff5f5}
.sale-cancelled td{text-decoration:none}
.cancelled-badge{display:inline-flex;padding:4px 8px;border-radius:999px;background:#fee2e2;color:#991b1b;font-size:11px;font-weight:900}
.cancel-reason{display:block;margin-top:4px;color:#991b1b;font-size:11px}
.danger-btn{background:#dc2626!important;border-color:#dc2626!important;color:#fff!important}
@media(max-width:640px){.sales-actions{display:grid;gap:6px}.sales-actions button{width:100%}}

.login-logo,.brand-mark,.logo-mark{overflow:hidden}
.login-logo img,.brand-mark img,.logo-mark img{width:100%;height:100%;object-fit:contain;display:block;border-radius:inherit}
.mobile-logout-btn{display:none;position:fixed;left:14px;bottom:90px;width:52px;height:52px;border-radius:50%;border:0;background:#dc2626;color:#fff;font-size:24px;font-weight:900;box-shadow:0 12px 30px rgba(220,38,38,.35);z-index:75}
@media(max-width:640px){
 .mobile-logout-btn{display:grid;place-items:center}
 #logoutBtn{display:none}
}

.auto-code-wrap{display:grid;grid-template-columns:1fr auto;gap:8px}
.auto-code-wrap input[readonly]{background:#f1f5f9;color:#334155;font-weight:800;letter-spacing:.06em}
.auto-code-note{display:block;margin-top:5px;color:var(--muted);font-size:11px}
@media(max-width:520px){.auto-code-wrap{grid-template-columns:1fr}}

.pos-search-row{display:flex;gap:8px;align-items:center;margin-bottom:10px}
.pos-search-row input{flex:1}
.barcode-box{width:min(560px,96vw)}
.barcode-camera-wrap{position:relative;background:#020617;border-radius:16px;overflow:hidden;aspect-ratio:4/3}
#barcodeVideo{width:100%;height:100%;object-fit:cover;display:block}
.barcode-guide{position:absolute;left:10%;right:10%;top:34%;height:32%;border:3px solid rgba(255,255,255,.9);border-radius:12px;box-shadow:0 0 0 999px rgba(0,0,0,.18)}
.barcode-guide:before{content:"";position:absolute;left:8%;right:8%;top:50%;height:2px;background:#22c55e;box-shadow:0 0 12px #22c55e}
.barcode-status{text-align:center;color:var(--muted);font-size:13px}
.barcode-manual{display:grid;grid-template-columns:1fr auto;gap:8px}
@media(max-width:520px){
 .pos-search-row{display:grid;grid-template-columns:1fr}
 .barcode-manual{grid-template-columns:1fr}
}
.cash-summary-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.cash-summary-grid>div{padding:14px;background:#f6f8fc;border:1px solid var(--line);border-radius:14px;display:grid;gap:5px}
.cash-summary-grid span{font-size:12px;color:var(--muted)}
.cash-summary-grid strong{font-size:18px}
.product-image-preview{min-height:130px;border:1px dashed var(--line);border-radius:14px;display:grid;place-items:center;background:#f8fafc;overflow:hidden}
.product-image-preview img{max-width:100%;max-height:220px;object-fit:contain}
.product-name-cell{display:flex;gap:10px;align-items:center;min-width:220px}
.product-thumb{width:48px;height:48px;border-radius:10px;object-fit:cover;border:1px solid var(--line);flex:0 0 auto}
.product-thumb-empty{display:grid;place-items:center;background:#f1f5f9;font-size:22px}
.pos-product-image{width:100%;height:120px;object-fit:cover;border-radius:12px;margin-bottom:10px;background:#f1f5f9}
.pos-product-image.placeholder{display:grid;place-items:center;font-size:38px}
@media(max-width:760px){.cash-summary-grid{grid-template-columns:1fr 1fr}}
@media(max-width:480px){.cash-summary-grid{grid-template-columns:1fr}}


/* v5.2.1 — navegación inferior con iconos SVG */
.nav-btn{
  align-items:center;
  font-weight:700;
  transition:background .18s ease,color .18s ease,transform .18s ease;
}
.nav-icon{
  width:22px;
  height:22px;
  display:grid;
  place-items:center;
  flex:0 0 auto;
}
.nav-icon svg{
  width:22px;
  height:22px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.nav-btn:hover{transform:translateY(-1px)}
.nav-btn.active .nav-icon svg{stroke-width:2.3}

@media(max-width:640px){
  main{padding-bottom:100px}
  .sidebar{
    height:82px;
    padding:7px 8px 8px;
    border-top:1px solid rgba(255,255,255,.08);
    box-shadow:0 -8px 28px rgba(2,6,23,.18);
  }
  .sidebar nav{
    height:100%;
    align-items:center;
    gap:5px;
    overflow-x:auto;
    justify-content:flex-start;
    scroll-snap-type:x proximity;
    padding:0 3px;
  }
  .nav-btn{
    flex:0 0 68px;
    min-width:68px;
    height:66px;
    padding:7px 5px;
    border-radius:14px;
    display:flex!important;
    flex-direction:column;
    justify-content:center;
    gap:5px;
    text-align:center;
    scroll-snap-align:start;
    color:#94a3b8;
  }
  .nav-icon,.nav-icon svg{
    width:24px;
    height:24px;
  }
  .nav-label{
    display:block!important;
    width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:9.5px;
    line-height:1;
  }
  .nav-btn.active{
    color:#fff;
    background:linear-gradient(180deg,#21345a,#182947);
    box-shadow:inset 0 0 0 1px rgba(96,165,250,.22),0 5px 14px rgba(0,0,0,.2);
  }
  .nav-btn.active .nav-icon{color:#60a5fa}
}


.pos-cash-alert{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  margin-bottom:16px;
  padding:14px 16px;
  border:1px solid #f6c453;
  border-radius:16px;
  background:#fff8e6;
  color:#7a4b00;
}
.pos-cash-alert>div{display:grid;gap:3px}
.pos-cash-alert strong{font-size:15px}
.pos-cash-alert span{font-size:12px}
.pos-cash-alert.hidden{display:none!important}
@media(max-width:560px){
  .pos-cash-alert{display:grid}
  .pos-cash-alert button{width:100%}
}


.cash-close-receipt-box{width:min(560px,96vw)}
.cash-close-receipt-preview{display:grid;place-items:center;background:#eef2f7;padding:16px;border-radius:14px}
.cash-close-ticket{width:min(80mm,100%);background:#fff;color:#000;padding:14px;box-shadow:0 8px 24px rgba(0,0,0,.15);font-size:12px}
.cash-close-title{font-size:16px}
.cash-close-line{border-top:1px dashed #000;margin:8px 0}
.cash-close-row{display:flex;justify-content:space-between;gap:12px;margin:5px 0}
.cash-close-total{font-size:14px}
.cash-close-difference{border:1px solid #000;padding:7px;margin-top:8px}
.cash-close-difference.ok{background:#ecfdf5}
.cash-close-difference.warn{background:#fff7ed}
.cash-close-note{margin-top:8px;padding:7px;border:1px solid #000}
.cash-close-actions{flex-wrap:wrap}
@media(max-width:520px){
 .cash-close-actions button{width:100%}
}


/* =========================================================
   V6.0 — TEMA DISTRIBUIDORA EL MANCHAS
   Paleta tomada del logo
   ========================================================= */
:root{
  --brand-orange:#f05a00;
  --brand-orange-2:#ff7a00;
  --brand-red:#c92a12;
  --brand-red-dark:#7d160d;
  --brand-brown:#2a120c;
  --brand-brown-2:#4a2115;
  --brand-gold:#f4b31a;
  --brand-cream:#fff7ea;
  --brand-soft:#fff1df;
  --brand-white:#fffdf9;
  --brand-ink:#2a1711;
  --brand-muted:#7a665e;
  --brand-line:#ead7ca;
  --brand-success:#15803d;
  --brand-danger:#b91c1c;
  --brand-shadow:0 18px 45px rgba(94,35,15,.14);

  --primary:var(--brand-orange);
  --primary-strong:var(--brand-red);
  --accent:var(--brand-gold);
  --bg:#fff7ef;
  --surface:#fffdf9;
  --text:var(--brand-ink);
  --muted:var(--brand-muted);
  --line:var(--brand-line);
}

html,body{
  background:
    radial-gradient(circle at top right,rgba(255,122,0,.10),transparent 30%),
    linear-gradient(180deg,#fffaf3 0%,#fff5e9 45%,#fff8f1 100%);
  color:var(--brand-ink);
}

body{
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

a{color:var(--brand-red)}

.brand-strip{
  margin:0 18px 18px;
  padding:13px 18px;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  color:#fff;
  background:
    linear-gradient(135deg,var(--brand-brown) 0%,var(--brand-red-dark) 42%,var(--brand-orange) 100%);
  box-shadow:0 14px 32px rgba(125,22,13,.22);
  border:1px solid rgba(255,255,255,.15);
}
.brand-strip span{font-weight:900;letter-spacing:.02em}
.brand-strip small{opacity:.9;font-weight:700}

.brand-logo{
  background:#fff!important;
  overflow:hidden;
  border:2px solid rgba(244,179,26,.7)!important;
  box-shadow:0 10px 26px rgba(125,22,13,.22)!important;
}
.brand-logo img{
  width:100%;
  height:100%;
  display:block;
  object-fit:contain;
}

.login-screen{
  background:
    radial-gradient(circle at 70% 15%,rgba(255,122,0,.28),transparent 28%),
    linear-gradient(145deg,#1e0e09 0%,#4b1c10 38%,#9a2412 68%,#f05a00 100%);
}
.login-card{
  border:1px solid rgba(244,179,26,.42);
  box-shadow:0 28px 80px rgba(42,18,12,.38);
  background:rgba(255,253,249,.98);
}
.login-card h1,.login-card h2{color:var(--brand-brown)}
.login-card input:focus{
  border-color:var(--brand-orange)!important;
  box-shadow:0 0 0 4px rgba(240,90,0,.13)!important;
}

.sidebar{
  background:
    linear-gradient(180deg,#1f0d08 0%,#32130c 48%,#4b1c10 100%)!important;
  border-right:1px solid rgba(244,179,26,.18);
  box-shadow:12px 0 34px rgba(42,18,12,.12);
}
.sidebar .brand,
.sidebar .brand-name,
.sidebar strong{
  color:#fff7ea;
}
.sidebar .brand-subtitle,
.sidebar small{
  color:#f5cda8!important;
}

.nav-btn{
  color:#d9b49c!important;
  border:1px solid transparent;
}
.nav-btn:hover{
  color:#fff!important;
  background:rgba(240,90,0,.14)!important;
  border-color:rgba(244,179,26,.20);
}
.nav-btn.active{
  color:#fff!important;
  background:
    linear-gradient(135deg,var(--brand-red-dark),var(--brand-red) 48%,var(--brand-orange))!important;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.12),
    0 10px 24px rgba(201,42,18,.28)!important;
}
.nav-btn.active .nav-icon{color:var(--brand-gold)!important}

.topbar,.header,.app-header{
  background:rgba(255,253,249,.92)!important;
  backdrop-filter:blur(14px);
  border-bottom:1px solid var(--brand-line)!important;
}
.session-user,.cloud-status{
  border:1px solid var(--brand-line);
}
.cloud-status.online{
  background:#ecfdf3!important;
  color:#166534!important;
}
.cloud-status.syncing{
  background:#fff7dc!important;
  color:#854d0e!important;
}
.cloud-status.offline{
  background:#fff1f0!important;
  color:#991b1b!important;
}

.card,.stat,.panel,.product-card,.payment-box,.modal-box{
  background:linear-gradient(180deg,#fffdf9 0%,#fffaf4 100%)!important;
  border:1px solid var(--brand-line)!important;
  box-shadow:var(--brand-shadow)!important;
}
.card,.stat,.panel{
  border-radius:22px!important;
}
.card-head{
  border-bottom-color:var(--brand-line)!important;
}
.card h2,.card h3,.stat strong{
  color:var(--brand-brown);
}

.stat{
  position:relative;
  overflow:hidden;
}
.stat:before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:5px;
  background:linear-gradient(180deg,var(--brand-gold),var(--brand-orange),var(--brand-red));
}
.stat span{color:var(--brand-muted)}
.stat strong{font-weight:900}
.stat small{color:#8b6f61}

button,.btn{
  border-radius:13px!important;
  font-weight:800!important;
  transition:transform .18s ease,box-shadow .18s ease,filter .18s ease!important;
}
button:hover,.btn:hover{
  transform:translateY(-1px);
  filter:brightness(1.02);
}
button.primary,.primary{
  color:#fff!important;
  border-color:transparent!important;
  background:
    linear-gradient(135deg,var(--brand-red-dark),var(--brand-red) 52%,var(--brand-orange))!important;
  box-shadow:0 10px 22px rgba(201,42,18,.24)!important;
}
button.ghost,.ghost{
  color:var(--brand-red-dark)!important;
  border:1px solid #e6bfa6!important;
  background:#fff8f0!important;
}
button.ghost:hover,.ghost:hover{
  background:#ffeddc!important;
}
.danger-btn{
  background:linear-gradient(135deg,#8f1111,#c52415)!important;
  box-shadow:0 10px 22px rgba(143,17,17,.22)!important;
}
.mobile-logout-btn{
  background:linear-gradient(135deg,#8f1111,#e2321b)!important;
  border:2px solid #ffc16a!important;
}

input,select,textarea{
  color:var(--brand-ink)!important;
  background:#fffdf9!important;
  border:1px solid #e5cdbd!important;
  border-radius:13px!important;
}
input:focus,select:focus,textarea:focus{
  outline:none!important;
  border-color:var(--brand-orange)!important;
  box-shadow:0 0 0 4px rgba(240,90,0,.12)!important;
}
label{color:#5a3527!important;font-weight:800!important}

table{
  border-collapse:separate;
  border-spacing:0;
}
thead th{
  color:#fff!important;
  background:
    linear-gradient(135deg,var(--brand-brown),var(--brand-red-dark))!important;
  border-bottom:none!important;
}
thead th:first-child{border-radius:12px 0 0 12px}
thead th:last-child{border-radius:0 12px 12px 0}
tbody tr{
  background:#fffdf9;
}
tbody tr:nth-child(even){
  background:#fff8ef;
}
tbody tr:hover{
  background:#ffeedb!important;
}
tbody td{
  border-bottom-color:#f0ddd0!important;
}

.badge.ok,.user-status.active{
  color:#166534!important;
  background:#eaf8ef!important;
  border:1px solid #bce6c8;
}
.badge.low,.user-status.inactive{
  color:#9a3412!important;
  background:#fff0e8!important;
  border:1px solid #f6c6ad;
}
.cancelled-badge{
  color:#fff!important;
  background:linear-gradient(135deg,#8f1111,#d12b16)!important;
}

.product-card{
  overflow:hidden;
  transition:transform .18s ease,box-shadow .18s ease!important;
}
.product-card:hover{
  transform:translateY(-3px);
  box-shadow:0 20px 38px rgba(125,22,13,.18)!important;
}
.pos-product-image{
  background:#fff4e6!important;
  border:1px solid #f2d5c0;
}
.product-card h3{color:var(--brand-brown)!important}
.product-card .price,.money{color:var(--brand-red)!important;font-weight:900}

.product-thumb{
  border:2px solid #f3d4bd!important;
  box-shadow:0 6px 15px rgba(94,35,15,.10);
}

.payment-head,.modal-head{
  background:
    linear-gradient(135deg,var(--brand-brown),var(--brand-red-dark) 55%,var(--brand-orange))!important;
  color:#fff!important;
}
.payment-head h2,.modal-head h2{color:#fff!important}
.payment-head p,.modal-head p{color:#ffe7cf!important}

.cash-session-card{
  border-top:4px solid var(--brand-orange)!important;
}
.cash-summary-grid>div{
  background:linear-gradient(180deg,#fff8ed,#fff3e4)!important;
  border:1px solid #efd2bd!important;
}
.cash-summary-grid strong{color:var(--brand-red-dark)}
.cash-close-ticket{
  border:2px solid #c77648!important;
  box-shadow:0 15px 35px rgba(94,35,15,.16)!important;
}
.cash-close-difference.ok{background:#ecfdf5!important}
.cash-close-difference.warn{background:#fff1e6!important}

.pos-cash-alert{
  color:#7c2d12!important;
  background:linear-gradient(135deg,#fff4dc,#ffe8c2)!important;
  border-color:#f4b31a!important;
}

.barcode-camera-wrap{
  border:3px solid var(--brand-orange);
}
.barcode-guide{
  border-color:var(--brand-gold)!important;
}
.barcode-guide:before{
  background:var(--brand-orange)!important;
  box-shadow:0 0 16px var(--brand-orange)!important;
}

.product-image-preview{
  background:
    linear-gradient(135deg,#fffaf3,#fff0df)!important;
  border:2px dashed #e0a77f!important;
}

.toast{
  background:linear-gradient(135deg,var(--brand-brown),var(--brand-red-dark))!important;
  color:#fff!important;
  border:1px solid rgba(244,179,26,.25);
  box-shadow:0 15px 38px rgba(42,18,12,.28)!important;
}

::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-track{background:#fff3e6}
::-webkit-scrollbar-thumb{
  background:linear-gradient(180deg,var(--brand-orange),var(--brand-red));
  border-radius:999px;
  border:2px solid #fff3e6;
}

@media(max-width:640px){
  .brand-strip{
    margin:8px 12px 14px;
    padding:11px 13px;
    border-radius:15px;
    display:grid;
  }
  .brand-strip small{font-size:10px}
  .sidebar{
    background:
      linear-gradient(180deg,#241009 0%,#3a160e 100%)!important;
    border-top:1px solid rgba(244,179,26,.22)!important;
  }
  .nav-btn{
    color:#d4af98!important;
  }
  .nav-btn.active{
    background:
      linear-gradient(180deg,#6f1d0f,#a72a13 60%,#e15a0a)!important;
  }
  .nav-btn.active .nav-icon{color:#ffd166!important}
  .nav-label{color:inherit!important}
  .card,.stat{border-radius:18px!important}
}

@media(prefers-reduced-motion:reduce){
  *{transition:none!important;animation:none!important}
}


/* =========================================================
   V6.1 — EXPERIENCIA POS PROFESIONAL
   ========================================================= */

#pos{
  max-width:1600px;
  margin:0 auto;
}

.pos-layout{
  grid-template-columns:minmax(0,1.65fr) minmax(370px,.72fr)!important;
  gap:20px!important;
  align-items:start;
}

.pos-catalog-card{
  min-height:calc(100vh - 190px);
  padding:18px!important;
  background:
    linear-gradient(180deg,#fffdf9 0%,#fff7ed 100%)!important;
}

.pos-catalog-head{
  display:grid!important;
  grid-template-columns:1fr minmax(280px,420px);
  align-items:end!important;
  gap:18px;
  padding-bottom:16px!important;
}

.section-kicker{
  display:block;
  margin-bottom:4px;
  color:var(--brand-orange);
  font-size:10px;
  font-weight:950;
  letter-spacing:.14em;
}

.pos-command-search{
  position:relative;
  width:100%;
}
.pos-command-search .search-icon{
  position:absolute;
  left:15px;
  top:50%;
  transform:translateY(-50%);
  color:var(--brand-orange);
  font-size:24px;
  line-height:1;
  z-index:1;
}
.pos-command-search input{
  width:100%!important;
  max-width:none!important;
  min-height:52px;
  padding-left:47px!important;
  padding-right:15px!important;
  font-size:15px;
  font-weight:700;
  border:2px solid #eccab3!important;
  box-shadow:0 7px 20px rgba(94,35,15,.07);
}

.pos-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:2px 0 18px;
}

.scan-barcode-btn{
  min-height:58px;
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 18px;
  color:#fff;
  border:0;
  background:linear-gradient(135deg,#2a120c,#7d160d 55%,#c92a12);
  box-shadow:0 12px 25px rgba(125,22,13,.20);
}
.scan-barcode-btn .scan-icon{
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  border-radius:10px;
  color:#2a120c;
  background:linear-gradient(135deg,#ffd166,#f4b31a);
  font-size:22px;
  font-weight:900;
}
.scan-barcode-btn span:last-child{
  display:grid;
  text-align:left;
}
.scan-barcode-btn strong{font-size:13px}
.scan-barcode-btn small{font-size:10px;opacity:.82;font-weight:600}

.pos-status-pill{
  display:flex;
  align-items:center;
  gap:8px;
  padding:9px 13px;
  border-radius:999px;
  color:#166534;
  background:#ecfdf3;
  border:1px solid #b7e4c3;
  font-size:11px;
  font-weight:900;
}
.status-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#22c55e;
  box-shadow:0 0 0 4px rgba(34,197,94,.12);
}

.product-grid{
  grid-template-columns:repeat(auto-fill,minmax(168px,1fr))!important;
  gap:14px!important;
}

.product-card{
  position:relative;
  min-height:224px;
  padding:10px!important;
  border-radius:18px!important;
  display:flex;
  flex-direction:column;
  background:#fff!important;
  border:1px solid #edd8c8!important;
}
.product-card:after{
  content:"+";
  position:absolute;
  right:10px;
  bottom:10px;
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  border-radius:10px;
  color:#fff;
  background:linear-gradient(135deg,var(--brand-red),var(--brand-orange));
  font-size:22px;
  font-weight:700;
  box-shadow:0 7px 16px rgba(201,42,18,.22);
}
.product-card:hover{
  border-color:var(--brand-orange)!important;
}
.product-card h3{
  padding-right:32px;
  font-size:14px!important;
  line-height:1.25;
}
.product-card p{
  padding-right:24px;
  min-height:30px;
}
.product-card .price{
  margin-top:auto!important;
  padding-top:8px;
  padding-right:38px;
  font-size:16px;
}
.pos-product-image{
  height:112px!important;
  border-radius:13px!important;
}

.pos-ticket-card{
  position:sticky!important;
  top:14px!important;
  border-radius:24px!important;
  overflow:hidden;
  border:1px solid #dbb89e!important;
  box-shadow:0 25px 55px rgba(74,33,21,.20)!important;
}
.pos-ticket-card:before{
  content:"";
  display:block;
  height:5px;
  background:linear-gradient(90deg,var(--brand-gold),var(--brand-orange),var(--brand-red));
}
.ticket-head{
  margin:-18px -18px 14px!important;
  padding:20px 18px 14px!important;
  color:#fff;
  background:
    linear-gradient(135deg,#2a120c 0%,#5f1b0e 55%,#9e2813 100%);
}
.ticket-head h2,.ticket-head p{color:#fff!important}
.ticket-head p{opacity:.72}
.ticket-head .section-kicker{color:#ffd166}
.clear-cart-btn{
  color:#ffd3c5!important;
  border:1px solid rgba(255,255,255,.15)!important;
  padding:7px 10px!important;
  border-radius:10px!important;
}
.clear-cart-btn:hover{background:rgba(255,255,255,.10)!important}

.pos-ticket-card .field-row,
.pos-ticket-card .discount-row{
  padding:0 1px;
}
.pos-ticket-card label{
  font-size:11px;
  letter-spacing:.02em;
}
.pos-ticket-card select,
.pos-ticket-card input{
  min-height:44px;
  font-weight:750;
}

.cart-items{
  min-height:150px;
  max-height:320px!important;
  margin:14px -4px!important;
  padding:0 4px;
}
.cart-items:empty:before{
  content:"Aún no agregaste productos";
  min-height:145px;
  display:grid;
  place-items:center;
  color:#9a7c6e;
  border:2px dashed #ead2c1;
  border-radius:14px;
  background:#fff9f3;
  font-size:13px;
  font-weight:700;
}
.cart-item{
  margin-bottom:8px;
  padding:11px!important;
  border:1px solid #ecd8c9!important;
  border-radius:13px;
  background:#fffaf5;
}
.qty button{
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  padding:0!important;
  border-radius:9px!important;
  color:#7d160d!important;
  background:#fff0df!important;
  border:1px solid #edc9ad!important;
}

.totals{
  margin-top:10px;
  padding:14px!important;
  border:1px solid #ecd1bc!important;
  border-radius:15px;
  background:linear-gradient(180deg,#fff8ef,#fff0df);
}
.totals .grand{
  margin-top:9px!important;
  padding-top:11px!important;
  font-size:22px!important;
  color:var(--brand-red-dark);
}
.totals .grand strong{
  font-size:25px;
  color:var(--brand-red)!important;
}

.checkout-pos-btn{
  min-height:64px;
  display:grid!important;
  grid-template-columns:42px 1fr 24px;
  align-items:center;
  gap:10px;
  margin-top:12px;
  padding:9px 14px!important;
  text-align:left;
  border-radius:17px!important;
  background:
    linear-gradient(135deg,#6d170d,#b42612 52%,#f05a00)!important;
  box-shadow:0 15px 30px rgba(180,38,18,.28)!important;
}
.checkout-pos-btn .checkout-icon{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:12px;
  color:#4a2115;
  background:linear-gradient(135deg,#ffe19b,#f4b31a);
  font-size:20px;
  font-weight:950;
}
.checkout-pos-btn span:nth-child(2){
  display:grid;
}
.checkout-pos-btn strong{font-size:16px}
.checkout-pos-btn small{font-size:10px;opacity:.84}
.checkout-arrow{
  font-size:30px;
  line-height:1;
}

@media(min-width:1300px){
  .product-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}

@media(max-width:1100px){
  .pos-layout{grid-template-columns:1fr!important}
  .pos-ticket-card{position:static!important}
  .pos-catalog-card{min-height:auto}
}

@media(max-width:640px){
  #pos{margin-top:0}
  .pos-layout{gap:12px!important}
  .pos-catalog-card{padding:12px!important}
  .pos-catalog-head{
    grid-template-columns:1fr!important;
    gap:12px;
  }
  .pos-command-search input{
    min-height:48px;
    font-size:13px;
  }
  .pos-toolbar{
    align-items:stretch;
  }
  .scan-barcode-btn{
    flex:1;
    min-height:52px;
    padding:8px 11px;
  }
  .pos-status-pill{display:none}
  .product-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:9px!important;
  }
  .product-card{
    min-height:190px;
    padding:8px!important;
  }
  .pos-product-image{height:86px!important}
  .product-card h3{font-size:12px!important}
  .product-card p{font-size:10px!important}
  .product-card .price{font-size:14px}
  .product-card:after{
    width:28px;height:28px;font-size:19px
  }
  .pos-ticket-card{
    border-radius:18px!important;
  }
  .ticket-head{
    margin:-18px -18px 12px!important;
  }
  .cart-items{max-height:none!important}
  .checkout-pos-btn{
    position:sticky;
    bottom:86px;
    z-index:6;
  }
}

.pos-dashboard-view{max-width:1700px;margin:0 auto}
.dashboard-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-bottom:16px}
.kpi-card{position:relative;overflow:hidden;padding:16px;border-radius:18px;background:#fff;border:1px solid #ead6c7;box-shadow:0 12px 28px rgba(94,35,15,.09)}
.kpi-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:5px;background:linear-gradient(180deg,#f4b31a,#f05a00,#c92a12)}
.kpi-card span{font-size:11px;font-weight:900;color:#6f4b3b;text-transform:uppercase;letter-spacing:.04em}
.kpi-card strong{display:block;margin:8px 0 4px;font-size:24px;color:#2a120c}
.kpi-card small{color:#8a6c5d}
.dashboard-grid-main{display:grid;grid-template-columns:1.35fr .9fr .72fr;gap:14px;margin-bottom:14px}
.dashboard-grid-bottom{display:grid;grid-template-columns:1.25fr .9fr .78fr .72fr;gap:14px;align-items:start}
.dashboard-chart-card,.dashboard-payment-card,.dashboard-alert-card{min-height:330px}
.dashboard-alerts{display:grid;gap:10px}
.dashboard-alert-item{display:flex;align-items:center;gap:10px;padding:12px;border-radius:14px;background:#fff8ef;border:1px solid #edd7c6}
.alert-icon{width:32px;height:32px;display:grid;place-items:center;border-radius:10px;color:#fff;background:linear-gradient(135deg,#c92a12,#f05a00);font-weight:900}
.dashboard-alert-item div{display:grid}.dashboard-alert-item small{color:#8a6c5d}
.payment-summary{display:grid;gap:12px}
.payment-summary-row{display:grid;grid-template-columns:12px 1fr auto auto;gap:8px;align-items:center;padding:9px 0;border-bottom:1px solid #f0dfd2}
.payment-dot{width:10px;height:10px;border-radius:50%;background:#f05a00}
.payment-dot.p1{background:#7c3aed}.payment-dot.p2{background:#0891b2}.payment-dot.p3{background:#eab308}.payment-dot.p4{background:#ef4444}
.top-products-table{display:grid;gap:8px}
.top-product-row{display:grid;grid-template-columns:28px 1fr auto;gap:10px;align-items:center;padding:10px;border-radius:12px;background:#fff8ef;border:1px solid #edd7c6}
.top-rank{width:26px;height:26px;display:grid;place-items:center;border-radius:8px;background:#2a120c;color:#ffd166;font-weight:900}
.top-product-row div{display:grid}.top-product-row small{color:#8a6c5d}
.dashboard-cash-summary{display:grid;gap:10px}
.cash-mini-row{display:flex;justify-content:space-between;padding:10px 0;border-bottom:1px solid #efded2}
.cash-mini-state{padding:10px;border-radius:12px;text-align:center;font-weight:900}
.cash-mini-state.open{background:#ecfdf3;color:#166534}
.audit-panel{background:linear-gradient(180deg,#2a120c,#4a2115)!important;color:#fff!important}
.audit-panel h2,.audit-panel p{color:#fff!important}.audit-panel .section-kicker{color:#ffd166}
.cancelled-sales-list{display:grid;gap:10px}
.cancelled-sale-card{display:grid;gap:5px;padding:11px;border-radius:12px;background:#fffdf9;color:#2a120c}
.cancelled-sale-card>div{display:flex;justify-content:space-between;align-items:center}
.cancelled-sale-card small{color:#7a665e}
@media(max-width:1400px){
 .dashboard-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}
 .dashboard-grid-main{grid-template-columns:1fr 1fr}
 .dashboard-alert-card{grid-column:1/-1}
 .dashboard-grid-bottom{grid-template-columns:1fr 1fr}
}
@media(max-width:760px){
 .dashboard-kpis{grid-template-columns:1fr 1fr}
 .dashboard-grid-main,.dashboard-grid-bottom{grid-template-columns:1fr}
 .dashboard-alert-card{grid-column:auto}
}
@media(max-width:460px){.dashboard-kpis{grid-template-columns:1fr}}


/* =========================================================
   v6.2.1 — CORRECCIÓN RESPONSIVE PARA HORIZONTAL / ESCRITORIO
   ========================================================= */

.app,
main,
.view,
.pos-dashboard-view{
  min-width:0;
  max-width:100%;
}

main{
  overflow-x:hidden;
}

.dashboard-grid-main > *,
.dashboard-grid-bottom > *,
.dashboard-kpis > *{
  min-width:0;
}

.card{
  max-width:100%;
}

.table-wrap{
  width:100%;
  max-width:100%;
}

/* Pantallas medianas, tablets y celulares en modo horizontal */
@media(max-width:1180px){
  .app{
    display:block!important;
    min-height:100vh;
  }

  main{
    width:100%!important;
    margin:0!important;
    padding:18px 18px 104px!important;
  }

  .sidebar{
    position:fixed!important;
    left:0!important;
    right:0!important;
    top:auto!important;
    bottom:0!important;
    z-index:120!important;
    width:100%!important;
    height:82px!important;
    min-height:82px!important;
    padding:7px 10px 8px!important;
    display:block!important;
    background:linear-gradient(180deg,#241009,#3a160e)!important;
    border-top:1px solid rgba(244,179,26,.28)!important;
    border-right:0!important;
    box-shadow:0 -10px 32px rgba(42,18,12,.28)!important;
  }

  .sidebar .brand,
  .sidebar .sidebar-foot{
    display:none!important;
  }

  .sidebar nav{
    display:flex!important;
    width:100%!important;
    height:100%!important;
    gap:6px!important;
    padding:0 3px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    justify-content:flex-start!important;
    align-items:center!important;
    scrollbar-width:none;
    scroll-snap-type:x proximity;
  }

  .sidebar nav::-webkit-scrollbar{
    display:none;
  }

  .nav-btn{
    flex:0 0 76px!important;
    min-width:76px!important;
    width:76px!important;
    height:66px!important;
    padding:7px 5px!important;
    display:flex!important;
    flex-direction:column!important;
    justify-content:center!important;
    align-items:center!important;
    gap:5px!important;
    border-radius:14px!important;
    text-align:center!important;
    scroll-snap-align:start;
  }

  .nav-btn span{
    display:block!important;
  }

  .nav-icon,
  .nav-icon svg{
    width:23px!important;
    height:23px!important;
    flex:0 0 auto!important;
  }

  .nav-label{
    display:block!important;
    width:100%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:9px!important;
    line-height:1!important;
  }

  .brand-strip{
    margin:0 0 14px!important;
    min-height:54px;
  }

  .dashboard-kpis{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }

  .dashboard-grid-main{
    grid-template-columns:minmax(0,1fr) minmax(280px,.72fr)!important;
  }

  .dashboard-alert-card{
    grid-column:1/-1!important;
    min-height:auto!important;
  }

  .dashboard-grid-bottom{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  .audit-panel{
    grid-column:auto!important;
  }

  .system-footer{
    margin-bottom:12px!important;
    padding-left:12px!important;
    padding-right:12px!important;
  }

  .mobile-logout-btn{
    bottom:94px!important;
    left:14px!important;
  }
}

/* Horizontal corto: evita tarjetas altas y espacios vacíos */
@media(max-width:1180px) and (max-height:760px){
  main{
    padding-top:10px!important;
  }

  .brand-strip{
    display:flex!important;
    padding:9px 14px!important;
    margin-bottom:10px!important;
  }

  .brand-strip small{
    display:none!important;
  }

  .dashboard-kpis{
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:8px!important;
    margin-bottom:10px!important;
  }

  .kpi-card{
    padding:11px 12px!important;
    border-radius:14px!important;
  }

  .kpi-card strong{
    margin:5px 0 2px!important;
    font-size:18px!important;
  }

  .kpi-card span{
    font-size:9px!important;
  }

  .kpi-card small{
    font-size:9px!important;
  }

  .dashboard-grid-main{
    grid-template-columns:1.25fr .8fr .72fr!important;
    gap:10px!important;
  }

  .dashboard-alert-card{
    grid-column:auto!important;
  }

  .dashboard-chart-card,
  .dashboard-payment-card,
  .dashboard-alert-card{
    min-height:260px!important;
  }

  .dashboard-grid-bottom{
    grid-template-columns:1.25fr .9fr .8fr .8fr!important;
    gap:10px!important;
  }

  .card{
    padding:14px!important;
  }

  .card-head{
    margin-bottom:12px!important;
  }

  .card-head h2{
    font-size:15px!important;
  }

  .card-head p{
    font-size:10px!important;
  }

  .bar-row{
    grid-template-columns:54px 1fr 72px!important;
    gap:7px!important;
    font-size:10px!important;
  }

  .payment-summary-row{
    font-size:10px!important;
    padding:6px 0!important;
  }

  .dashboard-alert-item{
    padding:8px!important;
  }

  .cancelled-sale-card{
    padding:8px!important;
  }
}

/* Tablet vertical y teléfonos grandes */
@media(max-width:820px){
  main{
    padding:14px 12px 100px!important;
  }

  .dashboard-kpis{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  .dashboard-grid-main,
  .dashboard-grid-bottom{
    grid-template-columns:1fr!important;
  }

  .dashboard-alert-card,
  .audit-panel{
    grid-column:auto!important;
  }

  .brand-strip{
    display:grid!important;
  }

  .topbar{
    flex-direction:column!important;
    align-items:stretch!important;
  }

  .top-actions{
    justify-content:flex-start!important;
  }
}

/* Teléfonos pequeños */
@media(max-width:480px){
  .dashboard-kpis{
    grid-template-columns:1fr!important;
  }

  .nav-btn{
    flex-basis:70px!important;
    min-width:70px!important;
    width:70px!important;
  }

  .brand-strip{
    margin-bottom:10px!important;
  }
}

/* Dispositivos táctiles en horizontal, incluso con “sitio para computadora” */
@media(pointer:coarse) and (orientation:landscape) and (max-height:800px){
  .app{
    display:block!important;
  }

  .sidebar{
    position:fixed!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    top:auto!important;
    width:100%!important;
    height:78px!important;
  }

  main{
    width:100%!important;
    padding-bottom:96px!important;
  }

  .sidebar .brand,
  .sidebar .sidebar-foot{
    display:none!important;
  }

  .sidebar nav{
    display:flex!important;
    overflow-x:auto!important;
  }
}


/* v6.2.2 — sin auditoría/papelera visible */
.dashboard-grid-bottom{
  grid-template-columns:1.35fr .95fr .8fr!important;
}
.audit-panel,
.cancelled-sales-list{
  display:none!important;
}
@media(max-width:1400px){
  .dashboard-grid-bottom{grid-template-columns:1fr 1fr!important}
}
@media(max-width:760px){
  .dashboard-grid-bottom{grid-template-columns:1fr!important}
}


.users-session-warning{
  display:grid;
  justify-items:center;
  gap:10px;
  padding:24px;
  text-align:center;
  border:1px solid #efc7aa;
  border-radius:16px;
  background:#fff7ef;
}
.users-session-warning strong{color:#7d160d;font-size:16px}
.users-session-warning span{color:#7a665e}
button:disabled{opacity:.62;cursor:not-allowed;transform:none!important}


/* =========================================================
   v6.2.6 — LAYOUT ESTABLE PARA ESCRITORIO, TABLET Y CELULAR
   ========================================================= */

:root{
  --sidebar-width:240px;
  --desktop-gap:22px;
}

html,body{
  width:100%;
  min-width:0;
  overflow-x:hidden;
}

body{
  margin:0;
}

.app{
  display:block!important;
  min-height:100vh;
  width:100%;
}

.sidebar{
  position:fixed!important;
  top:0!important;
  left:0!important;
  bottom:0!important;
  width:var(--sidebar-width)!important;
  min-width:var(--sidebar-width)!important;
  max-width:var(--sidebar-width)!important;
  height:100vh!important;
  z-index:100!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}

main{
  display:block!important;
  width:calc(100% - var(--sidebar-width))!important;
  min-width:0!important;
  max-width:none!important;
  margin-left:var(--sidebar-width)!important;
  padding:18px 22px 34px!important;
  box-sizing:border-box!important;
  overflow-x:hidden!important;
}

main > *{
  min-width:0!important;
  max-width:100%!important;
}

.brand-strip{
  width:100%!important;
  max-width:none!important;
  margin:0 0 18px!important;
  box-sizing:border-box!important;
}

.view{
  display:none!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  margin:0!important;
  box-sizing:border-box!important;
  position:relative!important;
  inset:auto!important;
  transform:none!important;
}

.view.active{
  display:block!important;
}

.view[hidden]{
  display:none!important;
}

.card,
.panel,
.stat,
.table-wrap,
.pos-layout,
.dashboard-grid-main,
.dashboard-grid-bottom,
.dashboard-kpis{
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}

.card{
  width:100%!important;
}

.table-wrap{
  overflow-x:auto!important;
}

table{
  width:100%!important;
  min-width:720px;
}

.dashboard-kpis{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
}

.dashboard-grid-main{
  grid-template-columns:minmax(0,1.5fr) minmax(300px,.85fr)!important;
}

.dashboard-alert-card{
  grid-column:1/-1!important;
}

.dashboard-grid-bottom{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}

.pos-layout{
  grid-template-columns:minmax(0,1.55fr) minmax(340px,.75fr)!important;
}

.pos-ticket-card{
  position:sticky!important;
  top:18px!important;
  align-self:start!important;
}

.system-footer{
  margin-left:0!important;
  width:100%!important;
}

/* Evita que elementos flotantes tapen contenido */
.mobile-logout-btn{
  z-index:130!important;
}

/* Laptop y monitor pequeño */
@media(max-width:1280px){
  :root{--sidebar-width:210px}

  main{
    padding:16px 16px 32px!important;
  }

  .dashboard-kpis{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  .dashboard-grid-main{
    grid-template-columns:1fr!important;
  }

  .dashboard-alert-card{
    grid-column:auto!important;
  }

  .dashboard-grid-bottom{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  .pos-layout{
    grid-template-columns:1fr!important;
  }

  .pos-ticket-card{
    position:static!important;
  }
}

/* Tablet y celular horizontal */
@media(max-width:900px){
  .sidebar{
    position:fixed!important;
    left:0!important;
    right:0!important;
    top:auto!important;
    bottom:0!important;
    width:100%!important;
    min-width:100%!important;
    max-width:100%!important;
    height:80px!important;
    padding:7px 10px!important;
    border-right:0!important;
    border-top:1px solid rgba(255,255,255,.10)!important;
  }

  .sidebar .brand,
  .sidebar .sidebar-foot{
    display:none!important;
  }

  .sidebar nav{
    display:flex!important;
    align-items:center!important;
    gap:6px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    height:100%!important;
    padding:0!important;
  }

  .nav-btn{
    flex:0 0 76px!important;
    min-width:76px!important;
    width:76px!important;
    height:64px!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:5px!important;
    padding:6px 4px!important;
  }

  .nav-label{
    display:block!important;
    font-size:9px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    width:100%!important;
    text-align:center!important;
  }

  main{
    width:100%!important;
    margin-left:0!important;
    padding:12px 12px 100px!important;
  }

  .brand-strip{
    margin-bottom:12px!important;
  }

  .dashboard-kpis,
  .dashboard-grid-main,
  .dashboard-grid-bottom,
  .pos-layout{
    grid-template-columns:1fr!important;
  }

  table{
    min-width:680px;
  }
}

/* Celular */
@media(max-width:560px){
  main{
    padding:10px 9px 96px!important;
  }

  .brand-strip{
    padding:10px 12px!important;
  }

  .brand-strip small{
    display:none!important;
  }

  .card{
    border-radius:16px!important;
  }

  .dashboard-kpis{
    grid-template-columns:1fr!important;
  }

  .nav-btn{
    flex-basis:70px!important;
    min-width:70px!important;
    width:70px!important;
  }

  table{
    min-width:620px;
  }
}

/* Pantallas táctiles en horizontal */
@media(pointer:coarse) and (orientation:landscape) and (max-height:800px){
  .sidebar{
    position:fixed!important;
    top:auto!important;
    bottom:0!important;
    left:0!important;
    right:0!important;
    width:100%!important;
    height:76px!important;
  }

  main{
    width:100%!important;
    margin-left:0!important;
    padding-bottom:92px!important;
  }
}


.whatsapp-btn,
.whatsapp-small-btn{
  color:#fff!important;
  border-color:transparent!important;
  background:linear-gradient(135deg,#128c7e,#25d366)!important;
  box-shadow:0 8px 18px rgba(18,140,126,.22)!important;
}
.whatsapp-btn:hover,
.whatsapp-small-btn:hover{
  filter:brightness(1.04);
}
.whatsapp-small-btn{
  padding:7px 10px!important;
  font-size:11px!important;
}


.printer-settings-title{
  margin-top:8px;
  padding-top:18px;
  border-top:1px solid var(--line);
}
.printer-settings-title h3{margin:2px 0 4px}
.printer-settings-title p{margin:0;color:var(--muted);font-size:12px}
.printer-control-panel{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px;
  border:1px solid #e9cdb8;
  border-radius:16px;
  background:linear-gradient(135deg,#fffaf4,#fff0df);
}
.printer-control-panel>div:first-child{display:grid;gap:4px}
.printer-control-panel small{color:var(--muted)}
#printerStatus[data-status="connected"]{color:#15803d}
#printerStatus[data-status="connecting"]{color:#a16207}
#printerStatus[data-status="error"]{color:#b91c1c}
.printer-help{
  display:flex;
  gap:6px;
  align-items:flex-start;
  padding:12px 14px;
  border-left:4px solid #f4b31a;
  border-radius:10px;
  color:#6d4a39;
  background:#fff8e7;
  font-size:12px;
}
@media(max-width:700px){
 .printer-control-panel{display:grid}
 .printer-control-panel .actions{display:grid;grid-template-columns:1fr 1fr}
 .printer-control-panel .actions button:last-child{grid-column:1/-1}
 .printer-help{display:grid}
}


/* =========================================================
   v6.2.9 — DASHBOARD EJECUTIVO
   ========================================================= */

.pos-dashboard-view{
  display:grid;
  gap:16px;
}

.executive-hero{
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(520px,.8fr);
  gap:20px;
  align-items:center;
  padding:22px;
  border-radius:24px;
  color:#fff;
  background:
    radial-gradient(circle at top right,rgba(255,209,102,.20),transparent 32%),
    linear-gradient(135deg,#241009 0%,#5d1b0e 52%,#b83215 100%);
  box-shadow:0 20px 44px rgba(74,33,21,.25);
}

.executive-brand{
  display:flex;
  align-items:center;
  gap:16px;
  min-width:0;
}

.executive-logo{
  width:76px;
  height:76px;
  flex:0 0 76px;
  display:grid;
  place-items:center;
  overflow:hidden;
  border:2px solid rgba(255,209,102,.72);
  border-radius:20px;
  color:#4a2115;
  background:#fff;
  font-size:24px;
  font-weight:950;
  box-shadow:0 12px 28px rgba(0,0,0,.22);
}

.executive-logo img{
  width:100%;
  height:100%;
  object-fit:contain;
}

.executive-brand h1{
  margin:2px 0 5px;
  color:#fff;
  font-size:clamp(22px,2.5vw,34px);
  line-height:1.08;
}

.executive-brand p{
  margin:0;
  color:#f8d8c3;
  font-size:13px;
}

.executive-brand .section-kicker{
  color:#ffd166;
}

.executive-status-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

.executive-status{
  display:grid;
  gap:4px;
  padding:11px 13px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:14px;
  background:rgba(255,255,255,.08);
  backdrop-filter:blur(8px);
}

.executive-status span{
  color:#edc9b3;
  font-size:9px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.executive-status strong{
  color:#fff;
  font-size:12px;
}

.status-open,.status-online{color:#9ef0b4!important}
.status-closed{color:#ffd166!important}
.status-pending{color:#ffe29a!important}
.status-local{color:#e6c3b0!important}

.dashboard-kpis{
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  gap:12px!important;
}

.executive-kpi{
  position:relative;
  display:grid!important;
  justify-items:start;
  min-width:0;
  padding:15px 15px 15px 18px!important;
  text-align:left;
  border:1px solid #ead6c7!important;
  border-radius:18px!important;
  background:#fff!important;
  box-shadow:0 12px 28px rgba(94,35,15,.09)!important;
}

.executive-kpi:before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:5px;
  border-radius:18px 0 0 18px;
  background:linear-gradient(180deg,#f4b31a,#f05a00,#c92a12);
}

.kpi-icon{
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  margin-bottom:9px;
  border-radius:10px;
  color:#fff;
  background:linear-gradient(135deg,#7d160d,#f05a00);
  font-size:13px;
  font-weight:950;
}

.kpi-title{
  color:#6f4b3b;
  font-size:10px;
  font-weight:900;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.executive-kpi strong{
  margin:5px 0 2px;
  color:#2a120c;
  font-size:22px;
}

.executive-kpi small{
  color:#8a6c5d;
  font-size:10px;
}

.quick-actions-card{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:20px;
  align-items:center;
  padding:16px 18px;
  border:1px solid #ead6c7;
  border-radius:20px;
  background:linear-gradient(180deg,#fffdf9,#fff7ed);
  box-shadow:0 12px 28px rgba(94,35,15,.08);
}

.quick-actions-card h2{
  margin:2px 0 0;
  color:#2a120c;
  font-size:17px;
}

.quick-actions-grid{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:8px;
}

.quick-action{
  display:grid!important;
  justify-items:start;
  min-height:76px;
  padding:10px 11px!important;
  color:#4a2115!important;
  text-align:left;
  border:1px solid #ead2c0!important;
  background:#fff!important;
  box-shadow:none!important;
}

.quick-action span{
  color:#c92a12;
  font-size:20px;
  line-height:1;
}

.quick-action strong{
  margin-top:3px;
  font-size:11px;
}

.quick-action small{
  color:#8a6c5d;
  font-size:9px;
}

.dashboard-grid-main{
  grid-template-columns:minmax(0,1.35fr) minmax(300px,.8fr) minmax(280px,.72fr)!important;
}

.dashboard-alert-card{
  grid-column:auto!important;
}

.executive-bottom-grid{
  grid-template-columns:1.4fr .85fr .8fr .8fr!important;
}

.dashboard-cash-card{
  grid-column:1/-1;
}

.dashboard-alert-item{
  width:100%;
  text-align:left;
  border:1px solid #edd7c6!important;
  box-shadow:none!important;
}

.alert-success{background:#eefbf2!important}
.alert-warning{background:#fff8e8!important}
.alert-danger{background:#fff0ed!important}

.critical-stock-list,
.recent-customers-list{
  display:grid;
  gap:8px;
}

.critical-stock-item,
.recent-customer-item{
  width:100%;
  display:flex!important;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 11px!important;
  text-align:left;
  border:1px solid #ead8ca!important;
  background:#fffaf5!important;
  box-shadow:none!important;
}

.critical-stock-item div,
.recent-customer-item div{
  display:grid;
  gap:2px;
  min-width:0;
}

.critical-stock-item strong,
.recent-customer-item strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#3c2016;
  font-size:11px;
}

.critical-stock-item small,
.recent-customer-item small{
  color:#8a6c5d;
  font-size:9px;
}

.stock-low,
.stock-out{
  min-width:38px;
  padding:5px 8px;
  border-radius:999px;
  text-align:center;
  font-size:10px;
  font-weight:950;
}

.stock-low{
  color:#9a3412;
  background:#ffedd5;
}

.stock-out{
  color:#991b1b;
  background:#fee2e2;
}

.recent-customer-item{
  justify-content:flex-start;
}

.recent-customer-item>span{
  width:30px;
  height:30px;
  flex:0 0 30px;
  display:grid;
  place-items:center;
  border-radius:10px;
  color:#fff;
  background:linear-gradient(135deg,#7d160d,#f05a00);
  font-size:11px;
  font-weight:950;
}

.dashboard-empty-action{
  display:grid;
  justify-items:center;
  gap:10px;
}

.cash-mini-state{
  width:100%;
  border:0!important;
}

@media(max-width:1500px){
  .dashboard-kpis{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }

  .quick-actions-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .dashboard-grid-main{
    grid-template-columns:1fr 1fr!important;
  }

  .dashboard-alert-card{
    grid-column:1/-1!important;
  }

  .executive-bottom-grid{
    grid-template-columns:1fr 1fr!important;
  }
}

@media(max-width:1050px){
  .executive-hero{
    grid-template-columns:1fr;
  }

  .quick-actions-card{
    grid-template-columns:1fr;
  }
}

@media(max-width:760px){
  .executive-hero{
    padding:16px;
  }

  .executive-status-grid{
    grid-template-columns:1fr 1fr;
  }

  .dashboard-kpis{
    grid-template-columns:1fr 1fr!important;
  }

  .quick-actions-grid{
    grid-template-columns:1fr 1fr;
  }

  .dashboard-grid-main,
  .executive-bottom-grid{
    grid-template-columns:1fr!important;
  }

  .dashboard-alert-card,
  .dashboard-cash-card{
    grid-column:auto!important;
  }
}

@media(max-width:480px){
  .executive-brand{
    align-items:flex-start;
  }

  .executive-logo{
    width:58px;
    height:58px;
    flex-basis:58px;
    border-radius:16px;
  }

  .executive-status-grid{
    grid-template-columns:1fr;
  }

  .dashboard-kpis{
    grid-template-columns:1fr!important;
  }
}


/* v6.3.0 — impresión estable por navegador */
.browser-print-panel{
  background:linear-gradient(135deg,#fffaf4,#fff3e7)!important;
}
.browser-print-panel strong{
  color:#5c2415;
}

.company-switcher{display:grid;gap:3px;min-width:210px}
.company-switcher span{color:#7a665e;font-size:9px;font-weight:900;letter-spacing:.08em;text-transform:uppercase}
.company-switcher select{min-height:38px!important;padding:7px 34px 7px 10px!important;color:#4a2115!important;font-size:11px;font-weight:900;background:#fff8ef!important;border:1px solid #e4c6b1!important}
.companies-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:4px 0 18px}
.companies-summary>div{display:grid;gap:4px;padding:14px;border:1px solid #ead6c7;border-radius:15px;background:linear-gradient(180deg,#fffdf9,#fff5e8)}
.companies-summary strong{color:#4a2115}.companies-summary small{color:#8a6c5d}
@media(max-width:900px){.company-switcher{width:100%;min-width:0}.companies-summary{grid-template-columns:1fr}}

.document-lookup-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.document-lookup-row button{min-height:42px;white-space:nowrap}
.lookup-status{display:block;min-height:17px;margin-top:5px;font-size:10px;line-height:1.35}
.lookup-status[data-state="loading"]{color:#9a6700}.lookup-status[data-state="success"]{color:#15803d}.lookup-status[data-state="error"]{color:#b91c1c}
@media(max-width:560px){.document-lookup-row{grid-template-columns:1fr}}


/* =========================================================
   v2.0.2 — CLIENTE MANUAL EN EL POS
   ========================================================= */
.pos-customer-box{
  display:grid;
  gap:11px;
  margin-bottom:13px;
  padding:13px;
  border:1px solid #ead2c0;
  border-radius:16px;
  background:linear-gradient(180deg,#fffdf9,#fff5e9);
}
.pos-customer-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.pos-customer-head>div{
  display:grid;
  gap:2px;
  min-width:0;
}
.pos-customer-head strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#3c2016;
  font-size:14px;
}
.pos-customer-head small{
  color:#8a6c5d;
  font-size:10px;
}
#saleCustomerStatus[data-state="success"]{color:#15803d}
#saleCustomerStatus[data-state="warning"]{color:#b45309}
#saleCustomerStatus[data-state="general"]{color:#8a6c5d}
.pos-customer-search{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:end;
}
.pos-customer-search button{
  min-height:42px;
  min-width:94px;
}
@media(max-width:560px){
  .pos-customer-head{
    display:grid;
  }
  .pos-customer-search{
    grid-template-columns:1fr;
  }
}

#saleDocumentType{font-weight:800;color:#5c160d}


/* v2.2.0 — comprobantes premium */
#receiptPdf{
  font-weight:850;
}


/* v2.3.0 — comprobante profesional rediseñado */
#receiptPdf{
  min-width:170px;
  font-weight:900;
}


/* =========================================================
   v3.0.0 — LICENCIAS Y PLANES
   ========================================================= */
.license-plan-badge{
 display:inline-flex;
 align-items:center;
 justify-content:center;
 padding:4px 8px;
 margin-right:8px;
 border-radius:999px;
 color:#fff;
 background:#6d28d9;
 font-size:8px;
 font-weight:950;
 letter-spacing:.08em
}
.license-plan-badge[data-plan="basic"]{background:#64748b}
.license-plan-badge[data-plan="professional"]{background:#0369a1}
.license-plan-badge[data-plan="enterprise"]{background:#6d28d9}
.license-plan-badge[data-plan="expired"]{background:#b91c1c}
.license-current-card{
 display:grid;
 grid-template-columns:1fr 1.5fr;
 gap:20px;
 padding:20px;
 margin-bottom:16px;
 border:1px solid #ddd6fe;
 border-radius:20px;
 background:linear-gradient(135deg,#faf5ff,#fff);
 box-shadow:0 14px 32px rgba(76,29,149,.10)
}
.license-current-card h2{margin:3px 0;font-size:28px;color:#4c1d95}
.license-current-card p{margin:0;color:#64748b}
.license-current-meta{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.license-current-meta>div{display:grid;gap:3px;padding:11px;border:1px solid #e9e5f5;border-radius:12px;background:#fff}
.license-current-meta span{font-size:9px;font-weight:900;color:#7c6f91;text-transform:uppercase}
.license-current-meta strong{color:#29213a}
.license-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px}
.license-installation-id{display:grid;gap:4px;padding:10px;border-radius:10px;background:#f8fafc}
.license-installation-id span{font-size:9px;font-weight:900;color:#64748b;text-transform:uppercase}
.license-installation-id code,.license-created code{overflow-wrap:anywhere}
.plan-comparison{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}
.plan-mini{display:grid;gap:4px;padding:12px;border:1px solid #e2e8f0;border-radius:13px;background:#fff}
.plan-mini.selected{border-color:#7c3aed;background:#faf5ff}
.plan-mini strong{color:#3b2267}
.plan-mini small{color:#64748b}
.license-admin-toolbar{display:flex;align-items:center;gap:8px;margin:6px 0 14px}
.license-admin-toolbar span{margin-left:auto;color:#64748b;font-size:10px}
.license-plan-pill{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:9px;font-weight:900}
.license-plan-pill.plan-basic{background:#e2e8f0;color:#334155}
.license-plan-pill.plan-professional{background:#e0f2fe;color:#075985}
.license-plan-pill.plan-enterprise{background:#ede9fe;color:#5b21b6}
.license-created{display:grid;gap:14px}
.license-created code{padding:14px;border:1px dashed #7c3aed;border-radius:12px;background:#faf5ff;font-size:16px;font-weight:900;text-align:center}
@media(max-width:900px){
 .license-current-card,.license-grid{grid-template-columns:1fr}
 .license-current-meta{grid-template-columns:1fr 1fr}
}
@media(max-width:560px){
 .license-current-meta,.plan-comparison{grid-template-columns:1fr}
}

.license-lock-banner{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 14px;padding:12px 14px;border:1px solid #fecaca;border-radius:14px;background:linear-gradient(135deg,#fff1f2,#fff);box-shadow:0 8px 20px rgba(185,28,28,.08)}
.license-lock-banner>div{display:grid;gap:2px}.license-lock-banner strong{color:#b91c1c;font-size:12px}.license-lock-banner span{color:#7f1d1d;font-size:10px}.license-lock-banner button{padding:9px 12px;border:0;border-radius:10px;color:#fff;background:#b91c1c;font-weight:850}
.license-disabled-action{opacity:.45!important;cursor:not-allowed!important;filter:grayscale(.35)}
.license-blocked-modal{display:grid;justify-items:center;gap:12px;text-align:center}.license-blocked-icon{display:grid;place-items:center;width:68px;height:68px;border-radius:50%;background:#fee2e2;font-size:30px}.license-blocked-modal h3{margin:0;color:#991b1b;font-size:18px}.license-blocked-modal p{margin:0;color:#475569;line-height:1.5}.license-blocked-actions{display:flex;gap:9px;margin-top:4px}.license-blocked-modal small{color:#64748b}
@media(max-width:560px){.license-lock-banner{align-items:stretch;flex-direction:column}.license-lock-banner button{width:100%}}

.license-client-layout{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.license-client-status{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.license-client-status>div{display:grid;gap:4px;padding:11px;border:1px solid #e2e8f0;border-radius:12px;background:#f8fafc}
.license-client-status span{font-size:9px;font-weight:900;color:#64748b;text-transform:uppercase}
.license-client-status strong{color:#1f2937}
.license-support-box{display:grid;gap:7px;margin-top:14px;padding:14px;border:1px solid #c7d2fe;border-radius:14px;background:#eef2ff}
.license-support-box strong{color:#3730a3}
.license-support-box p{margin:0;color:#475569;line-height:1.45}
.license-support-box a{justify-self:start;padding:9px 12px;border-radius:10px;background:#16a34a;color:#fff;font-weight:850;text-decoration:none}
@media(max-width:800px){.license-client-layout{grid-template-columns:1fr}}
@media(max-width:520px){.license-client-status{grid-template-columns:1fr}}


/* =========================================================
   v3.2.0 — ACTIVACIÓN COMERCIAL OBLIGATORIA
   ========================================================= */
.license-activation-required .sidebar .nav-btn:not([data-view="licenses"]){
 display:none!important;
}
.license-activation-overlay{
 position:fixed;
 inset:0;
 z-index:9999;
 display:grid;
 place-items:center;
 padding:20px;
 background:rgba(25,14,34,.82);
 backdrop-filter:blur(8px);
}
.license-activation-card{
 width:min(440px,100%);
 display:grid;
 justify-items:center;
 gap:11px;
 padding:30px;
 border:1px solid rgba(255,255,255,.2);
 border-radius:24px;
 color:#fff;
 background:linear-gradient(145deg,#321442,#572063);
 box-shadow:0 30px 100px rgba(0,0,0,.38);
 text-align:center
}
.license-activation-icon{
 display:grid;
 place-items:center;
 width:72px;
 height:72px;
 border-radius:22px;
 background:rgba(255,255,255,.13);
 font-size:32px
}
.license-activation-card>span{
 margin-top:3px;
 color:#d9c5e2;
 font-size:9px;
 font-weight:950;
 letter-spacing:.14em
}
.license-activation-card h2{
 margin:0;
 font-size:27px
}
.license-activation-card p{
 margin:0;
 max-width:340px;
 color:#e5d8eb;
 line-height:1.5
}
.license-activation-card button{
 min-height:44px;
 margin-top:5px;
 padding:10px 16px;
 border:0;
 border-radius:12px;
 color:#42154f;
 background:#fff;
 font-weight:950
}
.license-activation-card small{
 margin-top:4px;
 color:#ccb8d5;
 overflow-wrap:anywhere
}
.license-activation-required #licenseLockBanner{
 display:none!important;
}

/* v3.2.2 — diagnóstico estable de licencias */
.license-activation-buttons{
 grid-column:1/-1;
 display:flex;
 gap:9px;
 flex-wrap:wrap
}
.license-activation-buttons button{
 min-height:44px
}
.license-diagnostic-result{
 min-height:20px;
 padding:0;
 border-radius:10px;
 font-size:11px;
 line-height:1.45
}
.license-diagnostic-result.success{
 padding:10px 12px;
 border:1px solid #bbf7d0;
 color:#166534;
 background:#f0fdf4
}
.license-diagnostic-result.error{
 padding:10px 12px;
 border:1px solid #fecaca;
 color:#991b1b;
 background:#fff1f2
}
@media(max-width:520px){
 .license-activation-buttons{
  display:grid;
  grid-template-columns:1fr
 }
}

/* v4.0.0 — motor modular */
.licensed-module-panel{margin-top:14px;padding:13px;border:1px solid #ddd6fe;border-radius:14px;background:#faf5ff}
.licensed-module-panel>strong{display:block;margin-bottom:9px;color:#5b21b6}
.licensed-module-list{display:flex;flex-wrap:wrap;gap:7px}
.licensed-module-list span{display:inline-flex;padding:6px 9px;border-radius:999px;font-size:9px;font-weight:850}
.licensed-module-list .ready{background:#dcfce7;color:#166534}
.licensed-module-list .pending{background:#fef3c7;color:#92400e}
