*{box-sizing:border-box}
:root{--teal:#14788c;--teal2:#239aaa;--blue:#3f80af;--bg:#e9e9e9;--green:#148a0d;--red:#ee4b4b;--shadow:0 8px 26px rgba(0,0,0,.08)}
body{margin:0;font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:#000;font-size:18px}
button,input,select,textarea{font:inherit}button{cursor:pointer}.hidden{display:none!important}.mt{margin-top:16px}
.login-view{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,var(--teal),#07323d);padding:20px}
.login-card{width:min(430px,100%);background:#fff;border-radius:18px;box-shadow:var(--shadow);padding:28px}
.login-card h1{margin:0;color:var(--teal);font-size:36px}.login-card p{color:#555}
.field{display:flex;flex-direction:column;gap:5px}.field label{font-weight:700;font-size:15px;letter-spacing:.3px}
input,select,textarea{border:1px solid #9ca3af;border-radius:6px;padding:9px 10px;background:#fff;min-width:0}textarea{min-height:80px}
input:focus,select:focus,textarea:focus{outline:2px solid rgba(35,154,170,.22);border-color:var(--teal)}
.btn{border:0;border-radius:5px;padding:8px 14px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:5px}
.btn.primary{background:var(--teal2);color:#fff}.btn.soft{background:#f5f5f5;color:#333;border:1px solid #bbb}.btn.danger{background:var(--red);color:#fff}.btn.success{background:#3aaa35;color:#fff}.btn.full{width:100%;margin-top:10px}.btn.sm{padding:5px 9px;font-size:15px}
.top-strip{height:42px;background:var(--teal);color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 14px;position:sticky;top:0;z-index:50}
.brand-title{font-size:32px;font-weight:900;line-height:1}.top-meta{display:flex;align-items:center;gap:20px;font-weight:700;letter-spacing:1px}.power{background:transparent;border:0;color:#fff;font-size:28px;padding:0}
.top-nav{height:52px;background:#000;display:flex;align-items:stretch;position:sticky;top:42px;z-index:49;overflow:hidden}
.nav-btn{background:#000;color:#fff;border:0;border-right:1px solid #8b8b8b;padding:0 14px;white-space:nowrap;font-size:15px;letter-spacing:2px;font-weight:600;flex:1}.nav-btn.active,.nav-btn:hover{background:#111}
.main{padding:16px 18px 40px}.section{display:none}.section.active{display:block}.page-title{font-size:42px;font-weight:900;margin:10px 0 20px}
.panel{background:transparent;margin-bottom:22px}.form-panel{background:#fff;border-radius:12px;padding:16px;box-shadow:var(--shadow)}
.panel-header{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:12px}.panel-header h2{margin:0;font-size:24px}
.form-grid{display:grid;grid-template-columns:repeat(3,minmax(180px,1fr));gap:14px;align-items:end}.field.wide{grid-column:1/-1}
.dashboard-grid{display:grid;grid-template-columns:repeat(4,minmax(170px,1fr));gap:16px;margin-bottom:22px}
.metric-card{background:#fff;border-radius:12px;padding:18px;box-shadow:var(--shadow);border-left:8px solid var(--teal)}
.metric-card span{display:block;color:#555;font-size:16px;margin-bottom:8px}.metric-card strong{font-size:30px}.metric-card.green{border-color:#20a658}.metric-card.orange{border-color:#f59e0b}.metric-card.red{border-color:#e84646}
.home-info{background:#fff;border-radius:12px;padding:18px;box-shadow:var(--shadow)}.info-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.info-grid div{background:#f7f7f7;border-radius:10px;padding:14px}.info-grid span{display:block;color:#666;font-size:15px;margin-bottom:4px}.info-grid strong{font-size:20px}
.products-toolbar{display:flex;gap:14px;align-items:center;margin-bottom:18px;flex-wrap:wrap}.products-toolbar input{margin-left:auto;max-width:360px}
.products-shell{background:#fff;border-radius:18px;box-shadow:var(--shadow);padding:14px}.products-top{display:flex;justify-content:space-between;gap:12px;margin-bottom:12px;color:#333}
.products-scroll{height:calc(100vh - 230px);min-height:420px;max-height:680px;overflow:auto;padding-right:8px;display:grid;gap:12px;align-content:start}.compact-scroll{min-height:360px}.missing-scroll{height:calc(100vh - 245px)}
.product-card,.missing-card,.supplier-card{display:grid;grid-template-columns:1.1fr 1.8fr 1fr 1fr 1fr auto;gap:12px;align-items:center;background:#fdfdfd;border:1px solid #e1e1e1;border-radius:14px;padding:14px;min-height:92px}
.supplier-card{grid-template-columns:1.4fr 1fr 1fr 1.5fr auto}
.product-card:hover,.missing-card:hover,.supplier-card:hover{background:#f8feff;border-color:#bfe9ef}.product-card b,.missing-card b,.supplier-card b{display:block}.product-card small,.missing-card small,.supplier-card small{display:block;color:#555;margin-top:4px}.product-actions{display:flex;flex-direction:column;gap:4px;align-items:flex-start}
.table-wrap{width:100%;overflow:auto}table{width:100%;border-collapse:collapse;background:#fff}th{background:var(--blue);color:#fff;text-align:left;padding:14px 12px;font-size:18px}td{padding:14px 12px;border-bottom:1px solid #ccc;vertical-align:middle}
.action-stack{display:flex;flex-direction:column;align-items:flex-start;gap:4px}.action-inline{display:flex;gap:8px;flex-wrap:wrap}.action-link{background:none;border:0;padding:0;font-size:18px}.action-link.add{color:#4fa83f}.action-link.edit{color:#00a6e8}.action-link.delete{color:var(--red)}
.sale-title{text-align:center;font-size:28px;font-weight:900;margin:10px 0 20px}.sale-card{width:min(1120px,100%);margin:0 auto}
.sale-find{margin-bottom:14px}.search-results{background:#fff;border:1px solid #bbb;border-radius:8px;max-height:260px;overflow:auto;margin-top:8px}.search-result{display:flex;justify-content:space-between;gap:12px;padding:10px;border-bottom:1px solid #eee}.search-result:hover{background:#f0fbfd}
.sale-table th{text-align:left}.sale-table input{max-width:120px}.sale-subheader{background:var(--teal)!important;color:#fff;text-align:center!important;font-weight:900;border-bottom:0}
.sale-extra-grid{display:grid;grid-template-columns:1.4fr .8fr .8fr auto;gap:14px;align-items:end;background:#fff;padding:12px}
.items-header th{background:var(--blue)!important}
.total-area{display:grid;grid-template-columns:1.2fr .9fr .9fr;gap:24px;background:#fff;padding:14px;border-top:1px solid #ccc;align-items:center}
.total-big{text-align:center;font-weight:900;font-size:26px;letter-spacing:1px}.received-box label,.change-box label{font-weight:900;}.change-output{height:39px;border:1px solid #9ca3af;border-radius:6px;background:#f8fafc;display:flex;align-items:center;padding:0 10px}
.payment-pill{display:flex;gap:14px;background:#fff;padding:12px;align-items:center;justify-content:flex-end}.payment-pill label{display:flex;align-items:center;gap:6px;font-weight:700}.payment-pill input{width:auto}
.sale-footer-actions{display:flex;gap:48px;justify-content:center;padding:34px 14px}.sale-footer-actions .btn{font-size:22px;padding:10px 28px}.sale-footer-actions .print{background:#000;color:#fff}
.sales-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:12px 0 18px}.sales-summary div{background:#fff;padding:14px;border-radius:8px;box-shadow:var(--shadow)}.sales-summary span{display:block;color:#555}.sales-summary strong{font-size:27px;color:var(--teal)}
.sale-history-card,.debt-card{background:#fff;border-radius:8px;margin-bottom:12px;padding:14px;box-shadow:0 2px 10px rgba(0,0,0,.05)}.sale-history-card summary{cursor:pointer;font-weight:900}
.debt-header{display:flex;justify-content:space-between;gap:12px;align-items:center}.debt-actions{display:flex;gap:8px;flex-wrap:wrap}.debt-total{font-size:24px;color:var(--red);font-weight:900}.debt-movements{margin-top:12px;border-top:1px solid #ddd;padding-top:10px}
.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.55);display:grid;place-items:center;padding:18px;z-index:1000}.modal{background:#fff;width:min(880px,100%);max-height:92vh;overflow:auto;border-radius:12px;padding:20px;box-shadow:0 20px 70px rgba(0,0,0,.3)}.modal-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.modal-header h2{margin:0}
.toast{position:fixed;right:18px;bottom:18px;background:#111;color:#fff;padding:12px 16px;border-radius:8px;z-index:1200;box-shadow:var(--shadow)}
.danger-text{color:var(--red);font-weight:900}.ok-text{color:var(--green);font-weight:900}

.delete-btn{
  width:36px;
  height:36px;

  display:flex;
  align-items:center;
  justify-content:center;

  border:none;
  border-radius:12px;

  background:transparent !important;

  padding:0 !important;

  transition:.18s ease;
}

.delete-btn:hover{
  background:#fef2f2 !important;
}

.delete-btn svg{
  width:24px;
  height:24px;

  fill:#ef6b6b;
}
@media(max-width:1180px){.nav-btn{font-size:12px;letter-spacing:1px;padding:0 8px}.product-card,.missing-card{grid-template-columns:1fr 1.5fr 1fr 1fr auto}.product-card .hide-md,.missing-card .hide-md{display:none}.supplier-card{grid-template-columns:1fr 1fr auto}}
@media(max-width:900px){
  body{font-size:16px}.top-strip{height:auto;min-height:48px;padding:8px 10px}.brand-title{font-size:26px}.top-meta{gap:8px;font-size:13px;flex-wrap:wrap}.top-nav{top:48px;height:auto;overflow-x:auto}.nav-btn{font-size:13px;padding:12px 10px;flex:0 0 auto}.main{padding:12px}.page-title{font-size:30px}
  .dashboard-grid,.form-grid,.sales-summary,.info-grid,.total-area{grid-template-columns:1fr}.products-toolbar{gap:10px}.products-toolbar input{max-width:none;width:100%;margin-left:0}.products-scroll{height:65vh;min-height:360px}.product-card,.missing-card,.supplier-card{grid-template-columns:1fr;gap:8px}
  th,td{font-size:15px;padding:10px}.sale-extra-grid{grid-template-columns:1fr}.sale-footer-actions{flex-direction:column;gap:12px}.sale-footer-actions .btn{width:100%}.payment-pill{justify-content:flex-start;flex-wrap:wrap}
}
@media(max-width:520px){.dashboard-grid{grid-template-columns:1fr}.top-meta span:not(:last-child){display:none}}

.qty-mini{max-width:82px!important;text-align:center}

.pretty-sale-card{
  padding:0;
  overflow:hidden;
  border:1px solid #d8e3e7;
}
.pretty-sale-card summary{
  list-style:none;
  cursor:pointer;
}
.pretty-sale-card summary::-webkit-details-marker{
  display:none;
}
.sale-summary-row{
  display:grid;
  grid-template-columns:1.4fr 1fr .8fr .8fr .8fr;
  gap:14px;
  align-items:center;
  padding:16px;
  background:#fff;
}
.sale-summary-row:hover{
  background:#f8feff;
}
.sale-summary-row span{
  display:block;
  color:#666;
  font-size:13px;
  font-weight:700;
  margin-bottom:4px;
}
.sale-summary-row strong{
  font-size:26px;
  color:var(--teal);
}
.sale-number{
  color:#111!important;
  font-size:15px!important;
}
.sale-detail{
  background:#f9fafb;
  border-top:1px solid #d8e3e7;
  padding:16px;
}
.sale-detail h3{
  margin:0 0 12px;
}
.sale-detail-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:14px;
}
@media(max-width:900px){
  .sale-summary-row{
    grid-template-columns:1fr;
  }
}

.sales-scroll{
  max-height:calc(100vh - 330px);
  min-height:340px;
  overflow:auto;
  padding-right:8px;
}
.notes-tabs{
  display:flex;
  gap:10px;
  margin-bottom:16px;
  flex-wrap:wrap;
}
.notes-tabs button{
  border:1px solid #bbb;
  background:#fff;
  border-radius:8px;
  padding:10px 14px;
  font-weight:900;
}
.notes-tabs button.active{
  background:var(--teal);
  color:#fff;
  border-color:var(--teal);
}
.notes-view{display:none}
.notes-view.active{display:block}
.movement-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px dashed #ddd;
  padding:8px 0;
}
.postit-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
  gap:16px;
}
.postit{
  background:#fff8b8;
  border:1px solid #eadf79;
  border-radius:10px;
  padding:16px;
  box-shadow:0 8px 20px rgba(0,0,0,.08);
  min-height:220px;
}
.postit-head{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px;
}
.postit-head small{
  color:#6b5f00;
  font-size:12px;
}
.postit-values{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.postit-values div{
  background:rgba(255,255,255,.55);
  border-radius:8px;
  padding:8px;
}
.postit-values span{
  display:block;
  color:#6b5f00;
  font-size:12px;
  font-weight:700;
}
.postit p{
  white-space:pre-wrap;
  line-height:1.35;
}
.postit-history{
  display:grid;
  gap:4px;
  border-top:1px dashed #b9a900;
  padding-top:10px;
}
.postit-history small{
  color:#4d4600;
}
.postit-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}
@media(max-width:900px){
  .sales-scroll{
    max-height:65vh;
  }
  .movement-row{
    flex-direction:column;
  }
}

/* Final responsive/overflow fixes */
.product-card,
.missing-card,
.supplier-card,
.search-product-card{
  min-width:0;
}

.product-card *,
.missing-card *,
.supplier-card *,
.search-product-card *{
  min-width:0;
}

.product-card b,
.product-card small,
.missing-card b,
.missing-card small,
.supplier-card b,
.supplier-card small,
.search-product-card b,
.search-product-card small{
  overflow-wrap:anywhere;
  word-break:break-word;
  white-space:normal;
}

.product-description-cell{
  min-width:0;
  overflow:hidden;
}

.sale-search-modal{
  width:min(980px,96vw);
  max-height:92vh;
}

.sale-search-scroll{
  height:min(62vh,560px);
  min-height:320px;
  max-height:560px;
  overflow:auto;
  align-content:start;
}

.sale-search-scroll .product-card{
  grid-template-columns:1fr 2fr .8fr .8fr auto;
  min-height:auto;
}

.sale-table{
  min-width:760px;
}

.sale-table td,
.sale-table th{
  overflow-wrap:anywhere;
  word-break:break-word;
}

.sale-card .table-wrap{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

.postit{
  background:#fff8b8;
}

.postit-title-input{
  width:100%;
  background:transparent;
  border:0;
  border-bottom:1px dashed #b9a900;
  border-radius:0;
  font-weight:900;
  font-size:20px;
  padding:4px 0;
}

.postit-title-input:focus{
  outline:none;
  box-shadow:none;
  border-color:#7c6f00;
}

.postit-textarea{
  width:100%;
  min-height:145px;
  background:rgba(255,255,255,.45);
  border:1px solid rgba(185,169,0,.35);
  resize:vertical;
  line-height:1.35;
}

.postit-date{
  display:block;
  color:#6b5f00;
  margin-top:8px;
}

@media(max-width:1180px){
  .top-nav{
    overflow-x:auto;
  }

  .nav-btn{
    flex:0 0 auto;
  }
}

@media(max-width:900px){
  body{
    font-size:15px;
  }

  .top-strip{
    position:sticky;
  }

  .brand-title{
    font-size:24px;
  }

  .page-title{
    font-size:28px;
  }

  .metric-card strong{
    font-size:24px;
  }

  .products-shell{
    padding:10px;
    border-radius:14px;
  }

  .products-top{
    flex-direction:column;
  }

  .product-card,
  .missing-card,
  .supplier-card,
  .sale-search-scroll .product-card{
    grid-template-columns:1fr;
    min-height:auto;
  }

  .sale-search-modal{
    width:96vw;
    padding:14px;
  }

  .sale-search-scroll{
    height:58vh;
    min-height:300px;
  }

  .sale-title{
    font-size:24px;
  }

  .total-big{
    font-size:22px;
  }

  .sale-footer-actions .btn{
    font-size:18px;
  }

  .payment-pill{
    align-items:flex-start;
  }

  .postit-grid{
    grid-template-columns:1fr;
  }
}

@media(max-width:520px){
  .main{
    padding:10px;
  }

  .top-meta{
    display:none;
  }

  .top-strip{
    justify-content:center;
  }

  .nav-btn{
    letter-spacing:.5px;
    font-size:12px;
    padding:10px 8px;
  }

  .dashboard-grid{
    gap:10px;
  }

  .metric-card{
    padding:14px;
  }

  .form-grid{
    gap:10px;
  }

  input,select,textarea{
    font-size:16px;
  }

  .sale-footer-actions{
    padding:18px 10px;
  }
}

/* V2 import/mobile fixes */
@media(max-width:900px){
  .sale-extra-grid{
    display:grid;
    grid-template-columns:1fr 90px 120px auto;
    gap:8px;
    align-items:end;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  .sale-extra-grid .field{
    min-width:0;
  }

  .sale-extra-grid label{
    font-size:12px;
    letter-spacing:.5px;
    white-space:nowrap;
  }

  .sale-extra-grid input,
  .sale-extra-grid select{
    min-width:0;
    width:100%;
  }

  .sale-extra-grid .btn{
    white-space:nowrap;
    height:40px;
    padding:6px 10px;
  }
}

@media(max-width:520px){
  .sale-extra-grid{
    grid-template-columns:180px 75px 105px 92px;
  }
}


/* =========================================================
   FINAL OVERRIDES - MOBILE SCROLL + HISTORIAL + PRODUCTS
   Keep this block at the END of styles.css
   ========================================================= */

.product-card,
.missing-card,
.supplier-card,
.search-product-card,
.pretty-sale-card,
.sale-summary-row {
  min-width: 0;
}

.product-card *,
.missing-card *,
.supplier-card *,
.search-product-card *,
.pretty-sale-card *,
.sale-summary-row * {
  min-width: 0;
}

.sale-date-time {
  white-space: nowrap !important;
  display: block !important;
}

.product-card b,
.product-card small,
.missing-card b,
.missing-card small,
.supplier-card b,
.supplier-card small,
.search-product-card b,
.search-product-card small {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

@media (max-width: 900px) {
  .products-shell {
    overflow-x: auto !important;
  }

  .products-scroll,
  .missing-scroll,
  .compact-scroll,
  .sale-search-scroll {
    overflow-x: auto !important;
    overflow-y: auto !important;
  }

  .product-card,
  .missing-card,
  .supplier-card,
  .sale-search-scroll .product-card {
    display: grid !important;
    grid-template-columns: 160px 260px 120px 120px 100px 120px !important;
    min-width: 900px !important;
    width: 900px !important;
    gap: 12px !important;
    align-items: center !important;
  }

  .supplier-card {
    grid-template-columns: 180px 140px 180px 240px 220px 120px !important;
    min-width: 1080px !important;
    width: 1080px !important;
    align-items: start !important;
  }

  .product-card .hide-md,
  .missing-card .hide-md {
    display: block !important;
  }

  #salesList,
  .sales-scroll {
    overflow-x: auto !important;
    overflow-y: auto !important;
  }

  .pretty-sale-card {
    min-width: 900px !important;
    width: 900px !important;
  }

  .sale-summary-row {
    grid-template-columns: 240px 180px 140px 120px 120px !important;
    min-width: 900px !important;
    width: 900px !important;
    gap: 14px !important;
    align-items: center !important;
  }

  .sale-summary-row small,
  .sale-summary-row strong,
  .sale-summary-row b {
    white-space: nowrap !important;
  }

  .sale-detail {
    overflow-x: auto !important;
  }

.sale-card {
  width: min(1120px, 100%);
  margin: 0 auto;
  overflow-x: auto;
  overflow-y: hidden;
}

  .sale-card .table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    -webkit-overflow-scrolling: touch;
  }

  .sale-card table,
  .sale-table {
    width: 950px !important;
    min-width: 950px !important;
    table-layout: fixed;
  }

  .sale-extra-grid {
    display: grid !important;
     grid-template-columns:1.4fr .8fr .8fr auto;
  min-width:950px;
    overflow-x: auto !important;
    gap: 8px !important;
    align-items: end !important;
    -webkit-overflow-scrolling: touch;
  }

  .sale-extra-grid .field {
    min-width: 0 !important;
  }

  .sale-extra-grid label {
    font-size: 12px !important;
    letter-spacing: .5px !important;
    white-space: nowrap !important;
  }

  .sale-extra-grid input,
  .sale-extra-grid select {
    min-width: 0 !important;
    width: 100% !important;
  }

  .sale-extra-grid .btn {
    white-space: nowrap !important;
    height: 40px !important;
    padding: 6px 10px !important;
  }
}

@media (max-width: 520px) {
  .main {
    padding: 10px !important;
  }

  .top-meta {
    display: none !important;
  }

  .top-strip {
    justify-content: center !important;
  }

  .nav-btn {
    letter-spacing: .5px !important;
    font-size: 12px !important;
    padding: 10px 8px !important;
  }

  .product-card,
  .missing-card,
  .supplier-card,
  .sale-search-scroll .product-card {
    grid-template-columns: 160px 260px 120px 120px 100px 120px !important;
    min-width: 900px !important;
    width: 900px !important;
  }

  .pretty-sale-card,
  .sale-summary-row {
    min-width: 900px !important;
    width: 900px !important;
  }
}


/* =========================================================
   FINAL V2 FIXES - MOBILE ACTIONS + SUPPLIER ADDRESS
   Keep at END
   ========================================================= */

.product-actions,
.action-inline,
.action-stack {
  min-width: 0 !important;
}

.product-actions {
  max-width: 100% !important;
  overflow: hidden !important;
}

.product-actions .action-link,
.action-inline .action-link,
.action-stack .action-link {
  white-space: nowrap !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* More room for the action column in mobile product rows */
@media (max-width: 900px) {
  .product-card,
  .missing-card,
  .sale-search-scroll .product-card {
    grid-template-columns: 150px 250px 110px 110px 90px 150px !important;
    min-width: 860px !important;
    width: 860px !important;
  }

  .supplier-card {
    grid-template-columns: 170px 140px 170px 220px 180px 150px !important;
    min-width: 1030px !important;
    width: 1030px !important;
  }

  .product-actions {
  width: 120px !important;
  min-width: 120px !important;
  margin-left: auto !important;
  align-items: flex-end !important;
  justify-content: center !important;
}
.supplier-card .product-actions {
  align-self: center !important;
  justify-self: end !important;
}

  .product-card .product-actions,
  .missing-card .product-actions,
  .sale-search-scroll .product-card .product-actions {
    background: #fdfdfd !important;
    padding: 4px !important;
    border-radius: 8px !important;
  }
}

@media (max-width: 520px) {
  .product-card,
  .missing-card,
  .sale-search-scroll .product-card {
    grid-template-columns: 150px 250px 110px 110px 90px 150px !important;
    min-width: 860px !important;
    width: 860px !important;
  }

  .supplier-card {
    grid-template-columns: 170px 140px 170px 220px 180px 150px !important;
    min-width: 1030px !important;
    width: 1030px !important;
  }
}

/* FIX REAL PROVEEDORES */
.products-shell,
.products-scroll {
  overflow-x: auto !important;
}

.supplier-card {
  display: grid !important;
  grid-template-columns:
    minmax(130px, 1.2fr)
    minmax(110px, .8fr)
    minmax(140px, 1fr)
    minmax(180px, 1.4fr)
    minmax(140px, 1fr)
    110px !important;
  width: 100% !important;
  min-width: 0 !important;
  gap: 12px !important;
  align-items: center !important;
}

.supplier-card .product-actions {
  grid-column: 6 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 110px !important;
  justify-self: stretch !important;
  align-self: center !important;
  align-items: flex-start !important;
  overflow: hidden !important;
}

.supplier-card .action-link {
  font-size: 16px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Solo en mobile se vuelve fila horizontal scrolleable */
@media (max-width: 900px) {
  .supplier-card {
    grid-template-columns: 150px 120px 150px 210px 150px 110px !important;
    width: 970px !important;
    min-width: 970px !important;
    max-width: 970px !important;
  }

  .supplier-card .product-actions {
    width: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;
  }
}
/* FIX REAL PRODUCTOS + FALTANTES */
.products-shell,
.products-scroll,
.missing-scroll {
  overflow-x: auto !important;
}

/* PRODUCTOS Y FALTANTES */
.product-card,
.missing-card {
  display: grid !important;

  grid-template-columns:
    minmax(140px, 1.2fr)
    minmax(220px, 2fr)
    minmax(90px, .8fr)
    minmax(90px, .8fr)
    minmax(70px, .6fr)
    120px !important;

  width: 100% !important;
  min-width: 0 !important;

  gap: 12px !important;
  align-items: center !important;
}

/* COLUMNA ACCIONES */
.product-card .product-actions,
.missing-card .product-actions {
  grid-column: 6 !important;

  width: 100% !important;
  max-width: 120px !important;
  min-width: 120px !important;

  justify-self: stretch !important;
  align-self: center !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;

  overflow: hidden !important;
}

/* LINKS */
.product-card .action-link,
.missing-card .action-link {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
}

/* TEXTO */
.product-card b,
.product-card small,
.missing-card b,
.missing-card small {
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

/* MOBILE */
@media (max-width: 900px) {
  .product-card,
  .missing-card {
    grid-template-columns:
      150px
      250px
      100px
      100px
      80px
      120px !important;

    width: 920px !important;
    min-width: 920px !important;
    max-width: 920px !important;
  }

  .product-card .product-actions,
  .missing-card .product-actions {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
  }
}

/* FIX VENTA 1 / VENTA 2 - UN SOLO SCROLL PARA TODO */
@media (max-width: 900px) {
  .sale-card {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .sale-card > * {
    min-width: 950px !important;
    width: 950px !important;
  }

  .sale-card .table-wrap {
    overflow: visible !important;
    width: 950px !important;
    min-width: 950px !important;
  }

  .sale-card table,
  .sale-table {
    width: 950px !important;
    min-width: 950px !important;
  }

  .sale-extra-grid,
  .total-area,
  .payment-pill,
  .sale-footer-actions {
    width: 950px !important;
    min-width: 950px !important;
    overflow: visible !important;
  }

  .sale-extra-grid {
    grid-template-columns: 1.4fr .8fr .8fr auto !important;
  }

  .total-area {
    grid-template-columns: 1.2fr .9fr .9fr !important;
  }

  .payment-pill {
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
  }

  .sale-footer-actions {
    flex-direction: row !important;
  }
}
/* SEPARAR TOTALES Y DESGLOSE EN VENTAS */
#ventas .form-panel {
  background: #ffffff !important;
  border-radius: 14px !important;
  padding: 16px !important;
  box-shadow: var(--shadow) !important;
  margin-bottom: 18px !important;
}

.sales-summary {
  background: #3895a7 !important;

  border: 1px solid #e7dcc7 !important;

  border-radius: 16px !important;
  padding: 14px !important;
  margin-bottom: 22px !important;

  box-shadow:
    0 4px 14px rgba(0,0,0,.04),
    inset 0 1px 0 rgba(255,255,255,.8) !important;
}

.sales-summary div {
  background: rgba(255,255,255,.78) !important;

  border: 1px solid #cad0ea !important;

  backdrop-filter: blur(8px);

  box-shadow: 0 2px 10px rgba(0,0,0,.03) !important;
}

.sales-scroll {
  background: #ffffff !important;
  border: 1px solid #d8d8d8 !important;
  border-radius: 16px !important;
  padding: 14px !important;
}

.pretty-sale-card {
  background: #f9fafb !important;
  border: 1px solid #d7e3e7 !important;
  margin-bottom: 12px !important;
}

.sale-detail {
  background: #ffffff !important;
}