/* RepuestoApp v5.1 — Botón y popup de ventas del día */
.sales-day-actions{
  display:flex;
  align-items:center;
  justify-content:center;
  flex:1;
  min-width:220px;
}
.day-sales-button{
  min-width:210px;
  border-radius:16px;
  box-shadow:0 16px 32px rgba(8,189,169,.2);
}
.day-sales-modal{
  width:min(1120px,calc(100vw - 28px));
  max-height:88vh;
  overflow:auto;
  padding:26px;
}
.day-sales-summary{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:12px;
  margin:18px 0 20px;
}
.day-sales-summary article{
  padding:14px 16px;
  border:1px solid #cbd6ee;
  border-radius:17px;
  background:#fbfcfe;
}
.day-sales-summary span{
  display:block;
  color:#7784bb;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.day-sales-summary strong{
  display:block;
  margin-top:7px;
  color:#3f4c9d;
  font-size:22px;
}
.day-sales-summary .credit{
  border-color:#f0b8bd;
  background:#fff5f6;
}
.day-sales-summary .credit strong{
  color:#d83245;
}
.day-sales-list{
  display:grid;
  gap:13px;
}
.day-sale-card{
  padding:15px;
  border:1px solid #cbd6ee;
  border-radius:18px;
  background:#fff;
  box-shadow:0 12px 28px rgba(67,79,137,.08);
}
.day-sale-card.is-credit{
  border-color:#f0a8b2;
  background:linear-gradient(145deg,#fff,#fff6f7);
}
.day-sale-card header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  padding-bottom:10px;
  border-bottom:1px solid #e3e8f4;
}
.day-sale-card header strong{
  color:#344394;
  font-size:15px;
}
.day-sale-card header small{
  display:block;
  margin-top:5px;
  color:#7481b6;
}
.day-sale-total{
  text-align:right;
  white-space:nowrap;
}
.day-sale-total span{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  background:#eef3fb;
  color:#4b5aa4;
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
}
.day-sale-total .credit-label{
  background:#ffe7ea;
  color:#d83245;
}
.day-sale-total b{
  display:block;
  margin-top:6px;
  color:#344394;
  font-size:18px;
}
.day-sale-card.is-credit .day-sale-total b{
  color:#d83245;
}
.day-sale-client{
  margin:12px 0;
  color:#5260a5;
}
.day-sale-card.is-credit .day-sale-client{
  color:#c62739;
}
.day-sale-products{
  display:grid;
  gap:7px;
}
.day-sale-products>div{
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px;
  align-items:center;
  padding:8px 10px;
  border-radius:12px;
  background:#f8fafc;
}
.day-sale-products span{
  color:#3f4c9d;
  font-weight:800;
}
.day-sale-products small{
  display:block;
  margin-top:3px;
  color:#7985b7;
  font-weight:700;
}
.day-sale-products b{
  color:#344394;
  white-space:nowrap;
}
.empty-state.compact{
  padding:28px;
}

@media(max-width:980px){
  .section-head{
    align-items:flex-start;
  }
  .sales-day-actions{
    order:3;
    width:100%;
    justify-content:flex-start;
  }
  .day-sales-button{
    width:100%;
  }
  .day-sales-summary{
    grid-template-columns:1fr 1fr;
  }
}
@media(max-width:620px){
  .day-sales-modal{
    padding:18px;
  }
  .day-sales-summary{
    grid-template-columns:1fr;
  }
  .day-sale-card header{
    display:grid;
  }
  .day-sale-total{
    text-align:left;
  }
  .day-sale-products>div{
    grid-template-columns:1fr;
  }
}
@media print{
  .day-sales-modal{
    display:none!important;
  }
}


/* RepuestoApp v5.2 — Popup más ancho y legible para ventas del día */
dialog.day-sales-modal,
.modal.day-sales-modal{
  width:min(1180px, calc(100vw - 46px))!important;
  max-width:1180px!important;
  min-width:min(860px, calc(100vw - 46px))!important;
  max-height:88vh!important;
  overflow:auto!important;
  padding:28px!important;
  border-radius:28px!important;
}

dialog.day-sales-modal .modal-head{
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:20px!important;
  margin-bottom:18px!important;
}

dialog.day-sales-modal .modal-head h2{
  font-size:clamp(28px, 3vw, 42px)!important;
  line-height:1.05!important;
  margin:8px 0 8px!important;
}

dialog.day-sales-modal .modal-head p{
  max-width:760px!important;
  margin:0!important;
  line-height:1.55!important;
}

dialog.day-sales-modal .icon-btn{
  flex:0 0 auto!important;
}

.day-sales-summary{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(140px,1fr))!important;
  gap:12px!important;
}

.day-sales-list{
  max-height:58vh!important;
  overflow:auto!important;
  padding-right:4px!important;
}

.day-sale-card{
  margin:0!important;
}

.day-sale-card header{
  display:flex!important;
  justify-content:space-between!important;
  align-items:flex-start!important;
  gap:18px!important;
}

.day-sale-card header>div:first-child{
  min-width:0!important;
}

.day-sale-products>div{
  display:grid!important;
  grid-template-columns:minmax(220px,1fr) auto!important;
  align-items:center!important;
  gap:12px!important;
}

.product-search-empty{
  margin-top:18px;
  padding:26px 18px;
  border:1.35px dashed #bdc9ea;
  border-radius:22px;
  background:#fbfcfe;
  color:#4c59a2;
  text-align:center;
}

.product-search-empty span{
  width:54px;
  height:54px;
  display:grid;
  place-items:center;
  margin:0 auto 10px;
  border-radius:17px;
  background:#eef9f7;
  font-size:24px;
}

.product-search-empty strong{
  display:block;
  font-size:18px;
  color:#344394;
  margin-bottom:5px;
}

.product-search-empty small{
  display:block;
  color:#7784bb;
  font-weight:700;
}

@media(max-width:920px){
  dialog.day-sales-modal,
  .modal.day-sales-modal{
    min-width:auto!important;
    width:calc(100vw - 24px)!important;
    max-height:90vh!important;
    padding:20px!important;
  }
  .day-sales-summary{
    grid-template-columns:1fr 1fr!important;
  }
  .day-sale-card header{
    display:grid!important;
  }
  .day-sale-total{
    text-align:left!important;
  }
  .day-sale-products>div{
    grid-template-columns:1fr!important;
  }
}

@media(max-width:560px){
  dialog.day-sales-modal,
  .modal.day-sales-modal{
    width:calc(100vw - 14px)!important;
    padding:16px!important;
    border-radius:22px!important;
  }
  .day-sales-summary{
    grid-template-columns:1fr!important;
  }
}
