/* =====================================================
   TRADE MANAGER · TARIFAS PRO
===================================================== */

.crm-pricebook-page,
.pricebook-pro-page{
  display:grid;
  gap:20px;
}

/* HERO */
.pricebook-hero-pro{
  min-height:126px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:24px 30px;
  border:1px solid var(--line-soft);
  border-top:4px solid var(--primary);
  border-radius:var(--radius-xl);
  background:
    radial-gradient(circle at 88% 12%,rgba(25,165,125,.14),transparent 32%),
    linear-gradient(135deg,var(--surface),var(--surface-2));
  box-shadow:var(--shadow);
}

.pricebook-hero-left{
  display:flex;
  align-items:center;
  gap:18px;
}

.pricebook-main-icon{
  width:66px;
  height:66px;
  display:grid;
  place-items:center;
  border-radius:22px;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:30px;
  box-shadow:var(--shadow-sm);
}

.pricebook-hero-left span,
.pricebook-card-head span{
  display:block;
  margin:0 0 7px;
  color:var(--primary);
  font-size:11px;
  line-height:1;
  font-weight:950;
  letter-spacing:.18em;
  text-transform:uppercase;
}

.pricebook-hero-left h1{
  margin:0;
  color:var(--heading);
  font-size:38px;
  line-height:1;
  font-weight:950;
  letter-spacing:-.055em;
}

.pricebook-hero-left p{
  max-width:760px;
  margin:10px 0 0;
  color:var(--muted);
  font-size:15px;
  line-height:1.42;
  font-weight:650;
}

.pricebook-hero-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.pricebook-hero-btn{
  white-space:nowrap;
}

/* KPIs */
.pricebook-kpi-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}

.pricebook-kpi-grid article{
  min-height:124px;
  display:grid;
  grid-template-columns:auto 1fr;
  gap:14px;
  align-items:center;
  padding:18px;
  border:1px solid var(--line-soft);
  border-top:4px solid var(--primary);
  border-radius:22px;
  background:linear-gradient(180deg,#fff,#fbfdfb);
  box-shadow:var(--shadow);
  position:relative;
  overflow:hidden;
}

.pricebook-kpi-grid article::after{
  content:"";
  position:absolute;
  right:-30px;
  top:-30px;
  width:92px;
  height:92px;
  border-radius:999px;
  background:rgba(15,107,87,.08);
}

.pricebook-kpi-grid article:nth-child(2){border-top-color:var(--success);}
.pricebook-kpi-grid article:nth-child(3){border-top-color:#8b5cf6;}
.pricebook-kpi-grid article:nth-child(4){border-top-color:#f97316;}

.radar-kpi-icon{
  width:52px;
  height:52px;
  display:grid;
  place-items:center;
  border-radius:17px;
  background:var(--primary-soft);
  font-size:24px;
}

.radar-kpi-icon.blue{background:var(--blue-soft);}
.radar-kpi-icon.green{background:var(--success-soft);}
.radar-kpi-icon.purple{background:#f3e8ff;}
.radar-kpi-icon.orange{background:var(--warning-soft);}

.pricebook-kpi-grid small{
  display:block;
  color:var(--muted);
  font-size:11px;
  font-weight:950;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.pricebook-kpi-grid strong{
  display:block;
  margin-top:8px;
  color:var(--heading);
  font-size:30px;
  line-height:1;
  font-weight:950;
}

.pricebook-kpi-grid em{
  display:inline-flex;
  margin-top:9px;
  padding:5px 9px;
  border-radius:999px;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:11px;
  font-style:normal;
  font-weight:900;
}

/* BRAND CARDS */
.pricebook-brand-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
}

.pricebook-brand-card{
  position:relative;
  overflow:hidden;
  min-height:310px;
  padding:22px;
  border:1px solid var(--line-soft);
  border-radius:26px;
  background:linear-gradient(180deg,#fff,#fbfdfb);
  box-shadow:var(--shadow);
}

.pricebook-brand-card::before{
  content:"";
  position:absolute;
  inset:0 0 auto 0;
  height:5px;
  background:linear-gradient(90deg,var(--primary),var(--primary-2));
}

.pricebook-brand-card.capricho::before{
  background:linear-gradient(90deg,#dc2626,#f97316);
}

.pricebook-brand-card.ffss::before{
  background:linear-gradient(90deg,#d97706,#facc15);
}

.pricebook-brand-head{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:14px;
  margin-bottom:18px;
}

.pricebook-logo{
  width:74px;
  height:74px;
  display:grid;
  place-items:center;
  border-radius:22px;
  background:#fff;
  border:1px solid var(--line-soft);
  box-shadow:var(--shadow-sm);
  overflow:hidden;
}

.pricebook-logo img{
  width:100%;
  height:100%;
  object-fit:contain;
  padding:8px;
}

.pricebook-logo span{
  display:none;
}

.pricebook-brand-head h3{
  margin:0;
  color:var(--heading);
  font-size:21px;
  font-weight:950;
  letter-spacing:-.035em;
}

.pricebook-brand-head p{
  margin:5px 0 0;
  color:var(--muted);
  font-size:13px;
  font-weight:750;
}

.pricebook-brand-head > strong{
  min-height:30px;
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  background:var(--warning-soft);
  color:var(--warning);
  font-size:10px;
  font-weight:950;
  white-space:nowrap;
}

.pricebook-brand-head > strong.active{
  background:var(--success-soft);
  color:var(--success);
}

.pricebook-active-box{
  padding:16px;
  border-radius:20px;
  background:
    radial-gradient(circle at 100% 0%,rgba(15,107,87,.12),transparent 34%),
    var(--primary-soft);
  margin-bottom:16px;
}

.pricebook-active-box span{
  color:var(--primary);
  font-size:11px;
  font-weight:950;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.pricebook-active-box strong{
  display:block;
  margin-top:8px;
  color:var(--heading);
  font-size:20px;
  font-weight:950;
}

.pricebook-active-box small{
  display:block;
  margin-top:5px;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}

.pricebook-brand-stats{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-bottom:16px;
}

.pricebook-brand-stats div{
  min-height:78px;
  padding:12px;
  border:1px solid var(--line-soft);
  border-radius:18px;
  background:#fff;
  box-shadow:var(--shadow-sm);
}

.pricebook-brand-stats span{
  display:block;
  font-size:18px;
}

.pricebook-brand-stats strong{
  display:block;
  margin-top:5px;
  color:var(--heading);
  font-size:18px;
  font-weight:950;
}

.pricebook-brand-stats small{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
}

.pricebook-brand-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* BOTTOM */
.pricebook-bottom-grid{
  display:grid;
  grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);
  gap:16px;
  align-items:start;
}

.pricebook-import-card,
.pricebook-history-card{
  padding:22px;
  border:1px solid var(--line-soft);
  border-radius:26px;
  background:linear-gradient(180deg,#fff,#fbfdfb);
  box-shadow:var(--shadow);
}

.pricebook-card-head{
  display:flex;
  align-items:flex-start;
  gap:14px;
  margin-bottom:18px;
}

.pricebook-card-icon{
  width:52px;
  height:52px;
  display:grid;
  place-items:center;
  border-radius:17px;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:24px;
}

.pricebook-card-head h2{
  margin:0;
  color:var(--heading);
  font-size:22px;
  font-weight:950;
  letter-spacing:-.035em;
}

.pricebook-card-head p{
  margin:6px 0 0;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
  line-height:1.4;
}

.pricebook-import-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-bottom:14px;
}

.pricebook-upload-zone{
  min-height:170px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:22px;
  border:2px dashed rgba(15,107,87,.28);
  border-radius:24px;
  background:
    radial-gradient(circle at 100% 0%,rgba(15,107,87,.08),transparent 34%),
    #fff;
  cursor:pointer;
}

.pricebook-upload-zone span{
  display:block;
  font-size:34px;
  margin-bottom:8px;
}

.pricebook-upload-zone strong{
  display:block;
  color:var(--heading);
  font-size:17px;
  font-weight:950;
}

.pricebook-upload-zone small{
  display:block;
  margin-top:5px;
  color:var(--muted);
  font-size:13px;
  font-weight:750;
}

.pricebook-upload-zone b{
  display:inline-flex;
  min-height:42px;
  align-items:center;
  padding:0 15px;
  border-radius:15px;
  background:var(--primary);
  color:#fff;
  font-size:13px;
  font-weight:950;
  white-space:nowrap;
}

.pricebook-import-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-top:16px;
  padding-top:16px;
  border-top:1px solid var(--line-soft);
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}

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

.pricebook-history-table td:first-child strong{
  color:var(--heading);
  font-weight:950;
}

.pricebook-history-table .crm-row-actions{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}

/* RESPONSIVE TABLET */
@media(max-width:1280px){
  .pricebook-kpi-grid{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }

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

  .pricebook-bottom-grid{
    grid-template-columns:1fr;
  }
}

/* =====================================================
   TARIFAS PRO · CIERRE VISUAL DEFINITIVO
   Único bloque final. No añadir más parches debajo.
===================================================== */

/* KPIs superiores */
.pricebook-kpi-grid article{
  min-width:0;
  overflow:hidden;
}

.pricebook-kpi-grid article strong{
  display:block;
  max-width:100%;
  color:var(--heading);
  font-size:24px;
  line-height:1;
  font-weight:950;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.pricebook-kpi-grid article:nth-child(2) strong{
  font-size:19px;
  letter-spacing:-.045em;
}

.pricebook-kpi-grid article small{
  font-size:11px;
  line-height:1.05;
}

.pricebook-kpi-grid article em{
  max-width:100%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Tarjetas de marca */
.pricebook-brand-card{
  height:100%;
  min-height:360px;
  display:flex;
  flex-direction:column;
  padding:18px;
  overflow:hidden;
}

.pricebook-brand-head{
  display:grid;
  grid-template-columns:64px minmax(0,1fr) 78px;
  gap:12px;
  align-items:start;
  min-height:112px;
  margin-bottom:14px;
}

.pricebook-logo{
  width:64px;
  height:64px;
  border-radius:18px;
  overflow:hidden;
}

.pricebook-logo img{
  width:100%;
  height:100%;
  object-fit:contain;
  padding:7px;
}

.pricebook-logo span{
  display:none !important;
}

.pricebook-brand-copy{
  min-width:0;
}

.pricebook-brand-copy h3,
.pricebook-brand-head h3{
  margin:4px 0 0;
  color:var(--heading);
  font-size:21px;
  line-height:1;
  font-weight:950;
  letter-spacing:-.035em;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.pricebook-brand-copy p,
.pricebook-brand-head p{
  margin:12px 0 0;
  color:var(--muted);
  font-size:14px;
  line-height:1.12;
  font-weight:850;
}

.pricebook-brand-copy p span{
  display:block;
  white-space:nowrap;
}

.pricebook-brand-head > strong{
  width:78px;
  min-height:28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 8px;
  border-radius:999px;
  background:var(--warning-soft);
  color:var(--warning);
  font-size:9px;
  font-weight:950;
  white-space:nowrap;
}

.pricebook-brand-head > strong.active{
  background:var(--success-soft);
  color:var(--success);
}

/* Caja tarifa activa */
.pricebook-active-box{
  min-height:104px;
  margin-bottom:16px;
}

.pricebook-active-box strong{
  display:block;
  max-width:100%;
  font-size:22px;
  line-height:1.05;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.pricebook-active-box small{
  font-size:12px;
}

/* Stats de tarjetas */
.pricebook-brand-stats{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-bottom:16px;
}

.pricebook-brand-stats div{
  min-width:0;
  min-height:74px;
  padding:12px 8px;
  overflow:hidden;
}

.pricebook-brand-stats strong{
  display:block;
  max-width:100%;
  margin-top:5px;
  color:var(--heading);
  font-size:21px;
  line-height:1;
  font-weight:950;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.pricebook-brand-stats div:nth-child(3) strong{
  font-size:14px;
  letter-spacing:-.055em;
}

.pricebook-brand-stats small{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:10px;
  line-height:1.05;
  font-weight:900;
  text-transform:uppercase;
}

/* Botones de tarjetas */
.pricebook-brand-actions{
  margin-top:auto;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.pricebook-brand-actions .mini-btn{
  min-height:40px;
  justify-content:center;
  text-align:center;
}

/* Historial */
.pricebook-history-card{
  padding:24px;
}

.pricebook-history-table{
  min-width:860px;
}

.pricebook-history-table th{
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.pricebook-history-table td{
  padding:14px 16px;
  vertical-align:middle;
  font-size:14px;
}

.pricebook-history-table td:nth-child(2){
  max-width:130px;
  word-break:break-word;
}

.pricebook-history-table .crm-row-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.pricebook-history-table .mini-btn{
  min-width:82px;
  min-height:34px;
  justify-content:center;
  border-radius:999px;
  font-size:11px;
}

/* Drawer versión tarifa */
.pricebook-version-drawer{
  width:min(1080px,calc(100vw - 34px));
}

.pricebook-version-drawer .drawer-head{
  position:sticky;
  top:0;
  z-index:5;
  background:rgba(255,255,255,.94);
  border-bottom:1px solid var(--line-soft);
  backdrop-filter:blur(12px);
}

/* Tablet */
@media(max-width:980px){
  .pricebook-kpi-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .pricebook-brand-grid{
    grid-template-columns:1fr;
  }

  .pricebook-hero-pro,
  .pricebook-import-footer{
    flex-direction:column;
    align-items:flex-start;
  }
}
/* ===== TARIFA VIEWER PRO ===== */

.pricebook-version-drawer .radar-table th:nth-child(5){
  color:#0f766e;
  font-weight:900;
}

.pricebook-version-drawer .radar-table th:nth-child(6){
  color:#15803d;
  font-weight:900;
}

.pricebook-version-drawer .radar-table td:nth-child(5){
  color:#0f766e;
  font-weight:800;
  font-size:15px;
}

.pricebook-version-drawer .radar-table td:nth-child(6){
  color:#15803d;
  font-weight:900;
  font-size:15px;
}

/* Badge visual */

.pricebook-version-drawer .radar-table td:nth-child(5){
  background:rgba(13,148,136,.08);
  border-radius:10px;
}

.pricebook-version-drawer .radar-table td:nth-child(6){
  background:rgba(22,163,74,.10);
  border-radius:10px;
}

/* Hover elegante */

.pricebook-version-drawer .radar-table tbody tr:hover td:nth-child(5){
  background:rgba(13,148,136,.15);
}

.pricebook-version-drawer .radar-table tbody tr:hover td:nth-child(6){
  background:rgba(22,163,74,.18);
}
/* ===== TARIFA VS MB0 ===== */

.pricebook-version-drawer .radar-table th:nth-child(5){
  color:#c2410c;
  font-weight:900;
}

.pricebook-version-drawer .radar-table th:nth-child(6){
  color:#166534;
  font-weight:900;
}

.pricebook-version-drawer .radar-table td:nth-child(5){
  background:#ffedd5;
  color:#c2410c;
  font-weight:900;
  font-size:17px;
  border-radius:14px;
  text-align:center;
}

.pricebook-version-drawer .radar-table td:nth-child(6){
  background:#dcfce7;
  color:#166534;
  font-weight:900;
  font-size:17px;
  border-radius:14px;
  text-align:center;
}
/* ===== DRAWER KPI PRO ===== */

.pricebook-drawer-kpis{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
  margin:20px 0 28px;
}

.pricebook-drawer-kpis article{
  background:#fff;
  border:1px solid #e6ecef;
  border-radius:18px;
  padding:16px;
  display:flex;
  align-items:center;
  gap:14px;
  box-shadow:0 10px 24px rgba(15,23,42,.06);
}

.pricebook-drawer-kpis span{
  font-size:24px;
}

.pricebook-drawer-kpis small{
  display:block;
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  color:#64748b;
  letter-spacing:.08em;
}

.pricebook-drawer-kpis strong{
  display:block;
  font-size:18px;
  font-weight:900;
  color:#0f2f2b;
}
.pricebook-version-toolbar{
  margin:0 0 18px;
}

.pricebook-version-toolbar input{
  width:100%;
  min-height:52px;
  padding:0 18px;
  border:1px solid var(--line-soft);
  border-radius:18px;
  background:#fff;
  color:var(--heading);
  font-size:15px;
  font-weight:800;
  box-shadow:var(--shadow-sm);
}
.pricebook-version-drawer .radar-table thead th{
  position:sticky;
  top:0;
  z-index:2;
  background:#fff;
}
/* TARIFAS · REMATE VISUAL FINAL */

.pricebook-hero-pro .ghost-btn,
.pricebook-hero-pro .pro-btn,
.tarifas-page .ghost-btn,
.tarifas-page .pro-btn{
  text-decoration:none !important;
}

.pricebook-brand-card{
  min-height:310px !important;
  display:grid !important;
  grid-template-rows:auto 1fr auto !important;
}

.pricebook-brand-head{
  display:grid !important;
  grid-template-columns:74px 1fr auto !important;
  align-items:center !important;
  gap:14px !important;
}

.pricebook-brand-logo,
.pricebook-brand-icon,
.pricebook-brand-head > span:first-child{
  width:74px !important;
  height:74px !important;
  min-width:74px !important;
  border-radius:24px !important;
  background:#fff !important;
  border:1px solid var(--line-soft) !important;
  display:grid !important;
  place-items:center !important;
  overflow:hidden !important;
}

.pricebook-brand-logo img,
.pricebook-brand-icon img{
  width:82% !important;
  height:82% !important;
  object-fit:contain !important;
}

.pricebook-brand-head h3{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:27px !important;
  line-height:1 !important;
}

.pricebook-brand-head p,
.pricebook-brand-head small{
  max-width:100%;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.pricebook-brand-card .pricebook-brand-actions{
  display:grid !important;
  grid-template-columns:1fr 1fr !important;
  gap:10px !important;
}

.pricebook-brand-card .mini-btn,
.pricebook-brand-card .ghost-btn{
  min-height:46px !important;
  border-radius:18px !important;
  font-size:13px !important;
  font-weight:950 !important;
  text-decoration:none !important;
}

.pricebook-active-box{
  min-height:106px !important;
  padding:18px !important;
  border-radius:22px !important;
}

.pricebook-brand-stats{
  gap:10px !important;
}

.pricebook-brand-stats article{
  min-height:82px !important;
  padding:12px !important;
  border-radius:18px !important;
}

.pricebook-import-card{
  padding:24px 28px !important;
  border-radius:30px !important;
}

.pricebook-import-card .pricebook-card-head{
  margin-bottom:14px !important;
}

.pricebook-import-card .radar-sf-form-grid,
.pricebook-import-card .pricebook-import-grid{
  gap:14px !important;
}

.pricebook-dropzone,
.pricebook-upload-zone,
.pricebook-file-zone{
  min-height:150px !important;
  padding:22px !important;
  border-radius:24px !important;
}

.pricebook-dropzone .pro-btn,
.pricebook-upload-zone .pro-btn,
.pricebook-file-zone .pro-btn{
  min-height:50px !important;
  min-width:240px !important;
}

.pricebook-history-card{
  padding:20px 28px !important;
  border-radius:30px !important;
}

.pricebook-history-card .table-wrap{
  max-height:320px !important;
  overflow:auto !important;
  border-radius:22px !important;
}

.pricebook-history-table th{
  padding:12px 14px !important;
  font-size:10px !important;
  letter-spacing:.13em !important;
}

.pricebook-history-table td{
  padding:12px 14px !important;
}

@media(max-width:1280px){
  .pricebook-brand-head{
    grid-template-columns:64px 1fr !important;
  }

  .pricebook-brand-logo,
  .pricebook-brand-icon,
  .pricebook-brand-head > span:first-child{
    width:64px !important;
    height:64px !important;
    min-width:64px !important;
  }

  .pricebook-brand-head h3{
    font-size:24px !important;
  }
}
/* RADAR TARIFAS · REMATE VISUAL */

.radar-salesforce-page .radar-sf-header{
  min-height:138px;
}

.radar-salesforce-page .radar-sf-tabs .ghost-btn,
.radar-salesforce-page .radar-sf-tabs .pro-btn{
  min-width:210px;
  text-decoration:none !important;
}

.radar-sf-kpis article{
  min-height:122px;
}

.radar-sf-panel{
  padding:26px 30px !important;
}

.radar-sf-panel .radar-sf-form-grid{
  align-items:end;
}

.radar-sf-panel input,
.radar-sf-panel select{
  min-height:54px;
}

.radar-sf-panel .radar-sf-upload{
  min-height:74px;
}

.radar-sf-illustration{
  width:96px;
  height:96px;
  min-width:96px;
  border-radius:26px;
}