/* =====================================================
   COTIZACIONES CRM · CPQ FINAL
===================================================== */

.quote-cpq-page{
  max-width:1480px;
  margin:0 auto;
  display:grid;
  gap:12px;
  color:var(--heading);
}

.quote-cpq-page *,
.quote-cpq-page *::before,
.quote-cpq-page *::after{
  box-sizing:border-box;
}

.quote-cpq-hero,
.quote-cpq-kpis article,
.quote-cpq-selector-strip,
.quote-cpq-panel,
.quote-save-strip,
.quote-collapsible{
  border:1px solid var(--line-soft);
  border-radius:24px;
  background:#fff;
  box-shadow:var(--shadow-sm);
}

.quote-cpq-hero,
.quote-cpq-panel,
.quote-save-strip,
.quote-collapsible{
  border-top:4px solid var(--primary);
  background:
    radial-gradient(circle at 92% 8%,rgba(25,165,125,.10),transparent 34%),
    #fff;
}

/* HERO */
.quote-cpq-hero{
  min-height:142px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:22px;
  padding:22px 28px;
}

.quote-cpq-hero-main{
  display:flex;
  align-items:center;
  gap:20px;
}

.quote-cpq-hero-icon{
  width:64px;
  height:64px;
  display:grid;
  place-items:center;
  flex:0 0 64px;
  border-radius:20px;
  background:var(--primary-soft);
  font-size:32px;
}

.quote-cpq-hero-main span,
.quote-cpq-panel-head small,
.quote-pricebook-title span{
  display:block;
  color:var(--primary);
  font-size:11px;
  font-weight:950;
  letter-spacing:.16em;
  text-transform:uppercase;
}

.quote-cpq-hero-main h1{
  margin:4px 0 7px;
  color:var(--heading);
  font-size:44px;
  line-height:1;
  font-weight:1000;
  letter-spacing:-.06em;
}

.quote-cpq-hero-main p{
  max-width:760px;
  margin:0;
  color:var(--muted);
  font-size:14px;
  line-height:1.35;
  font-weight:800;
}

.quote-cpq-hero-actions{
  display:flex;
  gap:12px;
}

/* BUTTONS */
.quote-cpq-page .pro-btn,
.quote-cpq-page .ghost-btn,
.quote-cpq-page .mini-btn{
  min-height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:0 18px;
  border-radius:999px;
  font-size:12px;
  font-weight:950;
  text-transform:uppercase;
  cursor:pointer;
  white-space:nowrap;
}

.quote-cpq-page .pro-btn{
  border:0;
  background:linear-gradient(135deg,var(--primary),#10b981);
  color:#fff;
  box-shadow:0 14px 28px rgba(4,120,87,.20);
}

.quote-cpq-page .ghost-btn,
.quote-cpq-page .mini-btn{
  border:1px solid var(--line-soft);
  background:#fff;
  color:var(--primary);
}

/* KPIS */
.quote-cpq-kpis{
  display:grid;
  grid-template-columns:repeat(8,minmax(0,1fr));
  gap:10px;
}

.quote-cpq-kpis article{
  min-height:96px;
  display:flex;
  align-items:center;
  gap:12px;
  padding:13px;
  border-top:3px solid var(--primary);
}

.quote-cpq-kpis article.blue{border-top-color:#2563eb;}
.quote-cpq-kpis article.green{border-top-color:#16a34a;}
.quote-cpq-kpis article.purple{border-top-color:#8b5cf6;}
.quote-cpq-kpis article.orange{border-top-color:#f97316;}
.quote-cpq-kpis article.teal{border-top-color:#14b8a6;}
.quote-cpq-kpis article.gold{border-top-color:#d4a72c;}
.quote-cpq-kpis article.brown{border-top-color:#92400e;}

.quote-cpq-kpis article > span{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  flex:0 0 42px;
  border-radius:15px;
  background:var(--primary-soft);
  font-size:22px;
}

.quote-cpq-kpis small{
  color:var(--muted);
  font-size:10px;
  font-weight:950;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.quote-cpq-kpis strong{
  display:block;
  margin-top:4px;
  color:var(--heading);
  font-size:25px;
  line-height:1;
  font-weight:1000;
}

.quote-cpq-kpis em{
  display:block;
  margin-top:5px;
  color:var(--muted);
  font-size:10px;
  font-style:normal;
  font-weight:850;
}

/* SELECTOR STRIP */
.quote-cpq-form{
  display:grid;
  gap:12px;
}

.quote-cpq-selector-strip{
  display:grid;
  grid-template-columns:1.4fr repeat(5,1fr);
  gap:9px;
  padding:10px;
  background:
    radial-gradient(circle at 92% 8%,rgba(25,165,125,.08),transparent 34%),
    #fff;
}

.quote-cpq-selector{
  min-height:78px;
  display:flex;
  align-items:center;
  gap:11px;
  padding:12px;
  border:1px solid var(--line-soft);
  border-radius:18px;
  background:#fff;
  color:var(--heading);
  text-align:left;
  cursor:pointer;
  box-shadow:var(--shadow-sm);
}

.quote-cpq-selector.active{
  background:linear-gradient(180deg,#fff,#effbf6);
  border-color:rgba(4,120,87,.18);
}

.quote-cpq-selector > span{
  width:40px;
  height:40px;
  display:grid;
  place-items:center;
  flex:0 0 40px;
  border-radius:14px;
  background:var(--primary-soft);
  font-size:21px;
}

.quote-cpq-selector small{
  display:block;
  color:var(--muted);
  font-size:10px;
  font-weight:950;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.quote-cpq-selector strong{
  display:block;
  margin-top:4px;
  color:var(--primary);
  font-size:13px;
  font-weight:1000;
}

.quote-cpq-selector em{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:10px;
  font-style:normal;
  font-weight:800;
}

.quote-cpq-account select,
.quote-cpq-account input{
  width:100%;
  min-height:32px;
  margin-top:5px;
  padding:0 10px;
  border:1px solid var(--line-soft);
  border-radius:12px;
  background:#fff;
  color:var(--heading);
  font-size:11px;
  font-weight:850;
}

.quote-client-box{
  min-height:42px;
  display:flex;
  align-items:center;
  padding:10px 14px;
  border:1px dashed var(--line-soft);
  border-radius:16px;
  background:#f8fafc;
  color:var(--muted);
  font-size:12px;
  font-weight:850;
}

/* COLLAPSIBLES */
.quote-hidden-sections{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

.quote-collapsible{
  overflow:hidden;
}

.quote-pricebook-head{
  min-height:70px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:13px 16px;
  cursor:pointer;
}

.quote-pricebook-title{
  display:flex;
  align-items:center;
  gap:12px;
}

.quote-pricebook-icon{
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  flex:0 0 44px;
  border-radius:15px;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:22px;
}

.quote-pricebook-title h3{
  margin:0;
  color:var(--heading);
  font-size:22px;
  line-height:1;
  font-weight:1000;
  letter-spacing:-.04em;
}

.quote-pricebook-title small{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:11px;
  font-weight:850;
}

.quote-pricebook-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

.quote-pricebook-actions strong{
  min-height:30px;
  display:inline-flex;
  align-items:center;
  padding:0 11px;
  border-radius:999px;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:11px;
  font-weight:950;
  text-transform:uppercase;
}

.quote-collapse-body{
  padding:12px 16px 16px;
  border-top:1px solid var(--line-soft);
}

.quote-collapsible.collapsed .quote-collapse-body{
  display:none;
}

/* CONDITIONS */
.quote-conditions-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}

.quote-observaciones-field,
.quote-condition-actions{
  grid-column:1/-1;
}

.quote-condition-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.quote-cpq-page .form-field{
  display:grid;
  gap:7px;
}

.quote-cpq-page .form-field label{
  color:var(--muted);
  font-size:10px;
  font-weight:950;
  text-transform:uppercase;
}

.quote-cpq-page input,
.quote-cpq-page select,
.quote-cpq-page textarea{
  width:100%;
  min-height:44px;
  padding:0 13px;
  border:1px solid var(--line-soft);
  border-radius:15px;
  background:#fff;
  color:var(--heading);
  font-size:13px;
  font-weight:850;
  outline:0;
}

.quote-cpq-page textarea{
  min-height:60px;
  padding:12px 13px;
}

.quote-cpq-page .crm-action-btn{
  min-height:62px;
  display:flex;
  align-items:center;
  gap:12px;
  padding:11px;
  border:1px solid var(--line-soft);
  border-radius:18px;
  background:#fff;
  color:var(--heading);
  text-align:left;
  cursor:pointer;
}

.quote-cpq-page .crm-action-btn.primary{
  background:linear-gradient(180deg,#fff,#effbf6);
  border-color:rgba(4,120,87,.18);
}

.quote-cpq-page .crm-action-btn span{
  width:40px;
  height:40px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:20px;
  font-weight:1000;
}

/* CHIPS */
.crm-quote-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.crm-quote-chips .actas-chip{
  min-height:36px;
  padding:0 13px;
  border:1px solid var(--line-soft);
  border-radius:999px;
  background:#fff;
  color:var(--primary);
  font-size:11px;
  font-weight:950;
  cursor:pointer;
}

.crm-quote-chips .actas-chip.active{
  background:linear-gradient(135deg,var(--primary),#10b981);
  color:#fff;
}

/* MAIN GRID */
.quote-cpq-main-grid{
  display:grid;
  grid-template-columns:1fr 1.1fr;
  gap:12px;
}

.quote-cpq-panel{
  padding:16px;
}

.quote-cpq-panel-head{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
}

.quote-cpq-panel-head > span{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  flex:0 0 42px;
  border-radius:15px;
  background:var(--primary-soft);
  font-size:21px;
}

.quote-cpq-panel-head h2{
  margin:3px 0 4px;
  color:var(--heading);
  font-size:22px;
  line-height:1;
  font-weight:1000;
  letter-spacing:-.04em;
}

.quote-cpq-panel-head p{
  margin:0;
  color:var(--muted);
  font-size:11px;
  font-weight:850;
}

/* EXEC PREVIEW */
.quote-exec-preview{
  display:grid;
  gap:12px;
}

.quote-exec-kpis{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:8px;
}

.quote-exec-kpis article{
  min-height:82px;
  padding:11px;
  border:1px solid var(--line-soft);
  border-radius:16px;
  background:#fff;
  box-shadow:var(--shadow-sm);
}

.quote-exec-kpis article.blue strong,
.money-blue{color:#1683f6 !important;}

.quote-exec-kpis article.green strong,
.money-green{color:#03a55a !important;}

.quote-exec-kpis article.orange strong,
.money-orange{color:#f97316 !important;}

.money-red{color:#dc2626 !important;}

.quote-exec-kpis small{
  color:var(--muted);
  font-size:9px;
  font-weight:950;
  text-transform:uppercase;
}

.quote-exec-kpis strong{
  display:block;
  margin-top:8px;
  color:var(--heading);
  font-size:21px;
  line-height:1;
  font-weight:1000;
}

.quote-exec-kpis span{
  display:block;
  margin-top:6px;
  color:var(--muted);
  font-size:10px;
  font-weight:800;
}

/* FAMILY DISTRIBUTION */
.quote-family-zone{
  display:grid;
  grid-template-columns:1fr 260px;
  gap:14px;
  padding:12px;
  border:1px solid var(--line-soft);
  border-radius:18px;
  background:#fff;
}

.quote-family-head strong{
  display:block;
  color:var(--heading);
  font-size:13px;
  font-weight:1000;
}

.quote-family-head small{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:10px;
  font-weight:850;
}

.quote-family-row{
  display:grid;
  grid-template-columns:90px 1fr 36px 34px;
  align-items:center;
  gap:8px;
  min-height:30px;
}

.quote-family-row span{
  color:var(--heading);
  font-size:11px;
  font-weight:850;
}

.quote-family-bar{
  height:9px;
  overflow:hidden;
  border-radius:999px;
  background:#e2e8f0;
}

.quote-family-bar i{
  display:block;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,var(--primary),#10b981);
}

.quote-family-row b,
.quote-family-row small{
  color:var(--muted);
  font-size:10px;
  font-weight:950;
}

.quote-family-total{
  display:flex;
  justify-content:space-between;
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid var(--line-soft);
  color:var(--heading);
  font-size:12px;
  font-weight:1000;
}

.quote-family-donut{
  display:grid;
  grid-template-columns:120px 1fr;
  align-items:center;
  gap:12px;
}

.quote-donut{
  width:120px;
  height:120px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:
    radial-gradient(circle,#fff 0 43%,transparent 44%),
    conic-gradient(var(--primary) 0deg,var(--primary) var(--donut-value),#dff4ec var(--donut-value) 360deg);
}

.quote-donut span{
  color:var(--heading);
  font-size:24px;
  font-weight:1000;
}

.quote-donut small{
  margin-top:28px;
  color:var(--muted);
  font-size:10px;
  font-weight:900;
}

.quote-donut-legend{
  display:grid;
  gap:8px;
}

.quote-donut-legend span{
  display:grid;
  grid-template-columns:10px 1fr 30px;
  align-items:center;
  gap:8px;
  color:var(--muted);
  font-size:10px;
  font-weight:850;
}

.quote-donut-legend i{
  width:10px;
  height:10px;
  border-radius:999px;
  background:var(--primary);
}

.quote-donut-legend b{
  color:var(--heading);
  font-weight:1000;
}

/* FIRST REFERENCES */
.quote-first-table-wrap{
  overflow:auto;
  border:1px solid var(--line-soft);
  border-radius:18px;
  background:#fff;
}

.quote-first-table{
  width:100%;
  min-width:760px;
  border-collapse:collapse;
}

.quote-first-table th{
  padding:11px 12px;
  background:#f1f5f9;
  color:var(--muted);
  font-size:9px;
  font-weight:950;
  letter-spacing:.08em;
  text-align:left;
  text-transform:uppercase;
}

.quote-first-table td{
  padding:11px 12px;
  border-top:1px solid var(--line-soft);
  color:var(--heading);
  font-size:11px;
  font-weight:850;
}

.quote-first-table td strong{
  display:block;
  color:var(--heading);
  font-size:11px;
  font-weight:1000;
}

.quote-first-table td small{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:10px;
  font-weight:800;
}

.quote-first-note{
  margin:10px 0 0;
  color:var(--muted);
  font-size:11px;
  font-weight:850;
}

.quote-preview-empty{
  min-height:70px;
  display:grid;
  place-items:center;
  padding:16px;
  border:1px dashed var(--line-soft);
  border-radius:16px;
  background:#f8fafc;
  color:var(--muted);
  font-size:12px;
  font-weight:900;
  text-align:center;
}

/* SAVE */
.quote-save-strip{
  min-height:76px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:13px 18px;
}

.quote-save-strip strong{
  display:block;
  color:var(--heading);
  font-size:15px;
  font-weight:1000;
}

.quote-save-strip small{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:12px;
  font-weight:850;
}

.quote-save-strip .pro-btn{
  min-width:260px;
  min-height:50px;
}

/* HISTORY */
.pricebook-history-table{
  min-width:1040px;
}

.quote-cpq-page .table-wrap{
  overflow:auto;
  border:1px solid var(--line-soft);
  border-radius:18px;
}

.quote-cpq-page .crm-row-actions{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}

.quote-cpq-page .radar-status{
  min-height:28px;
  display:inline-flex;
  align-items:center;
  padding:0 10px;
  border-radius:999px;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:11px;
  font-weight:950;
}

/* DRAWER */
.quote-lines-drawer-backdrop{
  position:fixed;
  inset:0;
  z-index:9999;
  display:flex;
  justify-content:flex-end;
  background:rgba(15,23,42,.35);
  backdrop-filter:blur(8px);
}

.quote-lines-drawer{
  width:min(1180px,92vw);
  height:100vh;
  padding:24px;
  overflow:auto;
  background:#f8fafc;
  box-shadow:-22px 0 44px rgba(15,23,42,.22);
}

.quote-lines-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:16px;
  padding:24px;
  border:1px solid var(--line-soft);
  border-top:4px solid var(--primary);
  border-radius:28px;
  background:#fff;
}

.quote-lines-head span{
  color:var(--primary);
  font-size:11px;
  font-weight:950;
  letter-spacing:.16em;
  text-transform:uppercase;
}

.quote-lines-head h2{
  margin:6px 0 0;
  color:var(--heading);
  font-size:34px;
  font-weight:1000;
  letter-spacing:-.05em;
}

.quote-lines-head p{
  margin:6px 0 0;
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}

.quote-lines-table-wrap{
  overflow:auto;
  border:1px solid var(--line-soft);
  border-radius:24px;
  background:#fff;
}

.quote-lines-table{
  width:100%;
  min-width:1180px;
  border-collapse:collapse;
}

.quote-lines-table th{
  padding:13px 14px;
  background:#f1f5f9;
  color:var(--muted);
  font-size:10px;
  font-weight:950;
  letter-spacing:.12em;
  text-align:left;
  text-transform:uppercase;
}

.quote-lines-table td{
  padding:12px 14px;
  border-top:1px solid var(--line-soft);
  color:var(--heading);
  font-size:12px;
  font-weight:850;
}

.quote-lines-table td strong{
  display:block;
  font-size:12px;
  font-weight:1000;
}

.quote-lines-table td small{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:10px;
  font-weight:800;
}

@media(max-width:1280px){
  .quote-cpq-kpis{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }

  .quote-cpq-selector-strip{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .quote-cpq-main-grid{
    grid-template-columns:1fr;
  }
}
/* COTIZACIONES · REMATE FINAL */

.quote-cpq-selector.active{
  border-color:rgba(4,120,87,.26);
  background:
    radial-gradient(circle at 92% 8%,rgba(16,185,129,.13),transparent 38%),
    #fff;
  box-shadow:0 16px 34px rgba(4,120,87,.12);
}

.quote-cpq-selector.active strong{
  color:#047857;
}

.quote-client-box{
  display:none !important;
}

.quote-preview-empty{
  min-height:92px;
  width:100%;
  display:grid;
  place-items:center;
  padding:18px;
  border:1px dashed rgba(100,116,139,.22);
  border-radius:18px;
  background:
    linear-gradient(135deg,#f8fafc,#f0fdfa);
  color:#64748b;
  font-size:13px;
  font-weight:950;
  text-align:center;
}

.quote-live-footer{
  position:sticky;
  bottom:14px;
  z-index:50;
  min-height:72px;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr)) 260px;
  align-items:center;
  gap:12px;
  padding:12px 16px;
  border:1px solid var(--line-soft);
  border-top:4px solid var(--primary);
  border-radius:26px;
  background:
    radial-gradient(circle at 92% 8%,rgba(25,165,125,.12),transparent 34%),
    rgba(255,255,255,.96);
  box-shadow:0 22px 44px rgba(15,23,42,.16);
  backdrop-filter:blur(12px);
}

.quote-live-footer div{
  min-height:46px;
  display:grid;
  align-content:center;
  padding:0 12px;
  border-radius:16px;
  background:#fff;
  border:1px solid var(--line-soft);
}

.quote-live-footer strong{
  display:block;
  color:var(--heading);
  font-size:20px;
  line-height:1;
  font-weight:1000;
}

.quote-live-footer small{
  display:block;
  margin-top:5px;
  color:var(--muted);
  font-size:10px;
  font-weight:950;
  text-transform:uppercase;
}

.quote-live-footer .pro-btn{
  width:100%;
  min-height:50px;
}

.quote-save-strip{
  display:none !important;
}

.quote-history-collapsed{
  margin-bottom:90px;
}

@media(max-width:1280px){
  .quote-live-footer{
    grid-template-columns:repeat(2,1fr);
  }

  .quote-live-footer .pro-btn{
    grid-column:1 / -1;
  }
}