/* RV Styles */
:root{ --rv-blue:#32679E; --rv-blue-light:#32679E; --rv-text:#1d2939; --rv-bg:#f5f9fe; }
*{box-sizing:border-box}
.rv-app{display:flex;min-height:70vh;font-family:'Montserrat',sans-serif;color:var(--rv-text)}
.rv-sidebar{width:260px;background:#fff;border-right:1px solid #e5e7eb;padding:16px 12px;position:sticky;top:0;height:100%}
.rv-logo{display:flex;align-items:center;justify-content:flex-start;margin-bottom:12px}
.rv-logo img{height:42px}
.rv-sidebar nav{display:flex;flex-direction:column;gap:8px}
.rv-nav{all:unset;cursor:pointer;padding:11px 12px;border-radius:12px;font-weight:700;color:#344054;font-size:15px;line-height:1.2;display:flex;align-items:center;gap:10px}
.rv-nav.active, .rv-nav:hover{background:var(--rv-blue);color:#fff}
.rv-logout{margin-top:14px;display:inline-block;color:#677; font-weight:700}
.rv-content{flex:1;padding:18px;background:var(--rv-bg)}
.rv-view{display:none}
.rv-view.show{display:block;animation:fade .2s ease}
@keyframes fade{from{opacity:0}to{opacity:1}}

h1{font-weight:800; margin:0 0 12px}
.rv-grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.rv-grid-2{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.rv-card{background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:16px;box-shadow:0 1px 2px rgba(0,0,0,.03)}
.rv-card .price{font-size:18px;font-weight:800;color:var(--rv-blue)}
.rv-btn{background:var(--rv-blue);color:#fff;border:1px solid transparent;border-radius:12px;padding:10px 14px;font-weight:700;cursor:pointer;font-size:14px;line-height:1.1;display:inline-flex;align-items:center;justify-content:center;gap:8px;white-space:nowrap}
.rv-btn.ghost{background:#fff;color:var(--rv-blue);border:1px solid rgba(50,103,158,.35)}
.rv-actions{display:flex;gap:10px;align-items:center;margin:12px 0}

.rv-miscot-header{display:flex;align-items:center;justify-content:space-between}
.rv-table-wrapper,.rv-table-wrap{background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:10px;overflow:auto}
.rv-table{width:100%;border-collapse:collapse}
.rv-table th, .rv-table td{border-bottom:1px solid #f0f2f5;padding:10px;text-align:left;font-size:14px}
.rv-table thead th{background:#32679E!important;color:#fff!important;font-weight:700;}
.rv-table td .tag{padding:3px 8px;border-radius:9999px;background:var(--rv-blue-light);font-weight:800;color:#0a2a44}
.rv-table .row-actions{display:flex;gap:8px}

/* Stepper moderno (compatible con markup actual) */
.rv-step-header{
  position:relative;
  margin: 6px 0 18px;
  padding: 14px 18px;
  display:grid;
  grid-template-columns: 34px 1fr 34px 1fr 34px 1fr;
  align-items:center;
  column-gap:10px;
  row-gap:8px;
}
.rv-step-header::before{
  content:"";
  position:absolute;
  left:17px;
  right:17px;
  top:27px;
  height:3px;
  background:#e6edf5;
  border-radius:999px;
  z-index:0;
}

/* Bullets */
.bullet{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border-radius:999px;
  background:#e6edf5;
  font-weight:800;
  font-size:14px;
  position:relative;
  z-index:1;
  transition:transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}

/* Labels (2,4,6) */
.rv-step-header > span:nth-child(2),
.rv-step-header > span:nth-child(4),
.rv-step-header > span:nth-child(6){
  font-weight:700;
  color:#667085;
  font-size:14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  position:relative;
  z-index:1;
}
.rv-step-header > span:nth-child(2){ text-align:left; }
.rv-step-header > span:nth-child(4){ text-align:center; }
.rv-step-header > span:nth-child(6){ text-align:right; }

/* Estados */
.bullet.active{
  background:var(--rv-blue);
  color:#fff;
  transform:scale(1.08);
  box-shadow:0 8px 18px rgba(50,103,158,.22);
}
.rv-step-header > .bullet.active + span{
  color:var(--rv-blue);
  font-weight:800;
}
.bullet.done{
  background:rgba(34,197,94,.15);
  color:#16a34a;
  box-shadow:none;
}
.rv-step-header > .bullet.done + span{
  color:#16a34a;
  font-weight:800;
}

/* Mobile: labels compactos */
@media (max-width:768px){
  .rv-step-header{
    grid-template-columns: 32px 1fr 32px 1fr 32px 1fr;
    padding:8px 0;
    column-gap:8px;
  }
  .rv-step-header::before{ top:25px; }
  .rv-step-header > span:nth-child(2),
  .rv-step-header > span:nth-child(4),
  .rv-step-header > span:nth-child(6){
    font-size:13px;
  }
  .bullet{width:32px;height:32px;}
}

.grid-2{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.rv-field{display:flex;flex-direction:column;gap:6px}
.rv-field input, .rv-field select, .rv-field textarea{padding:10px;border:1px solid #e5e7eb;border-radius:10px;background:#fff}
.rv-field label{font-weight:800}

.rv-panels{display:grid;grid-template-columns:2fr 2fr 1fr; gap:16px}
.panel{background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:12px}
.panel .big{font-size:28px;font-weight:800;color:var(--rv-blue)}

.rv-reference{opacity:.08;width:100%;margin-top:8px;border-radius:12px}

.rv-stats-toolbar{display:flex;gap:10px;align-items:center;margin-bottom:10px}

/* Responsive */
@media (max-width:80px){
  .rv-grid-3{grid-template-columns:1fr}
  .rv-grid-2{grid-template-columns:1fr}
  .grid-3{grid-template-columns:1fr}
  .rv-panels{grid-template-columns:1fr}
  .rv-sidebar{width:210px}
}
@media (max-width:80px){
  .rv-app{flex-direction:column;}
  .rv-sidebar{
    position:fixed;
    top:0;
    left:0;
    bottom:0;
    z-index:40;
    width:260px;
    background:#fff;
    transform:translateX(-100%);
    transition:transform .25s ease, box-shadow .25s ease;
    box-shadow:0 0 0 rgba(15,23,42,0);
  }
  .rv-sidebar.is-open{
    transform:translateX(0);
    box-shadow:0 0 0 100vmax rgba(15,23,42,.45);
  }
  .rv-content{
    padding-bottom:72px;
  }
}

/* Floating action button for mobile menu */
.rv-fab-menu{
  position:fixed;
  right:16px;
  bottom:16px;
  width:52px;
  height:52px;
  border-radius:999px;
  border:none;
  background:var(--rv-blue);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:26px;
  font-weight:800;
  box-shadow:0 10px 25px rgba(15,23,42,.35);
  cursor:pointer;
  z-index:50;
}
.rv-fab-menu span{
  display:block;
  width:20px;
  height:2px;
  background:#fff;
  position:relative;
}
.rv-fab-menu span::before,
.rv-fab-menu span::after{
  content:'';
  position:absolute;
  left:0;
  width:20px;
  height:2px;
  background:#fff;
}
.rv-fab-menu span::before{
  top:-6px;
}

/* ================================
   Pantalla: Acceso restringido
   ================================ */
.rv-restricted-wrap{
  min-height:70vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:48px 16px;
  background:
    radial-gradient(900px 500px at 15% 85%, rgba(50,103,158,.18), rgba(50,103,158,0) 55%),
    radial-gradient(900px 500px at 85% 15%, rgba(50,103,158,.18), rgba(50,103,158,0) 55%),
    linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%);
  border-radius:18px;
}
.rv-restricted-card{
  width:min(520px, 92vw);
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:28px 28px 22px;
  box-shadow:0 22px 50px rgba(15,23,42,.14);
}
.rv-restricted-brand{margin-bottom:10px}
.rv-restricted-logo{height:58px; width:auto; display:block}
.rv-restricted-title{
  margin:0 0 6px;
  font-size:34px;
  line-height:1.05;
  font-weight:900;
  letter-spacing:-.02em;
  color:#111827;
}
.rv-restricted-text{
  margin:0 0 16px;
  font-size:15px;
  line-height:1.55;
  color:#475467;
  max-width:52ch;
}
.rv-restricted-actions{display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin:10px 0 16px}
.rv-restricted-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 18px;
  border-radius:12px;
  background:var(--rv-blue);
  color:#fff;
  font-weight:900;
  text-decoration:none;
  border:2px solid var(--rv-blue);
  box-shadow:0 10px 18px rgba(50,103,158,.25);
}
.rv-restricted-btn:hover{filter:brightness(.98)}
.rv-restricted-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:9999px;
  background:#f2f7ff;
  border:2px solid #c9d9ee;
  color:#1d5f9f;
  font-weight:900;
  font-size:13px;
  white-space:nowrap;
}
.rv-restricted-footer{
  text-align:center;
  font-size:13px;
  color:#667085;
  font-weight:700;
  margin-top:4px;
}
.rv-fab-menu span::after{
  top:6px;
}
@media (min-width: 961px){
  .rv-fab-menu{display:none;}
}

/* === FIXES === */
html body .rv-content{font-size:14px}
h1{font-size:20px;font-weight:700}
h2{font-size:18px;font-weight:700}
h3{font-size:16px;font-weight:700}
.rv-card .price{font-size:16px}
.rv-btn{font-size:14px}
.rv-field label{font-size:13px}
.rv-table th, .rv-table td{font-size:13px}
/* Chart sizing */
.rv-chart-wrap{max-width:100%;}
#rv-status-chart{height:260px !important}
/* Hide reference mock images to avoid ghost/reflection */
.rv-reference{display:none !important}

/* Agent panel positioned at top-right in Inicio */
.rv-inicio-grid{display:grid;grid-template-columns:minmax(0,1.4fr) 320px;gap:32px;align-items:start;justify-content:space-between}
.rv-inicio-left > canvas{display:block;width:100%}
.rv-agent-card{padding:16px}
.rv-agent-head{display:flex;gap:12px;align-items:center;margin-bottom:10px}
.rv-agent-head img{width:64px;height:64px;border-radius:50%;object-fit:cover;border:2px solid var(--rv-blue-light)}
.rv-agent-name{font-weight:800}
.rv-agent-code{font-weight:700;color:#475467}
@media (max-width:80px){ .rv-inicio-grid{grid-template-columns:1fr} }

/* Paso 3 - resumen y métricas */
.rv-summary-grid{
  display:grid;
  grid-template-columns:minmax(0,180px) minmax(0,1fr);
  row-gap:8px;
  column-gap:16px;
  align-items:center;
  font-size:14px;
}
.rv-summary-label{
  font-weight:700;
  color:#1f2933;
}
.rv-summary-value{
  font-weight:600;
  color:#111827;
}

.rv-metrics-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
  gap:12px;
  margin-top:8px;
}
.rv-metric-card{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--rv-blue-light);
  background:#f9fafb;
  box-shadow:0 1px 2px rgba(15,23,42,0.04);
}
.rv-metric-label{
  font-size:13px;
  font-weight:600;
  color:var(--rv-blue);
}
.rv-metric-value{
  margin-top:2px;
  font-size:16px;
  font-weight:800;
  color:#111827;
}

/* Paso 3 - estilo corporativo AFP */
.rv-card-summary{
  position:relative;
  border-radius:20px;
  padding:22px 28px;
  border:1px solid rgba(148, 163, 184, 0.35);
  background: radial-gradient(circle at top left, rgba(55,127,182,0.04), transparent 55%), #ffffff;
  box-shadow:0 18px 45px rgba(15,23,42,0.06);
}
.rv-card-summary::before{
  content:'';
  position:absolute;
  inset:0;
  border-radius:20px;
  border-left:4px solid var(--rv-blue);
  pointer-events:none;
}
.rv-card-summary h3{
  margin-top:0;
  margin-bottom:18px;
  font-size:18px;
  font-weight:800;
  color:var(--rv-blue);
}
.rv-card-summary .rv-summary-label{
  color:#6b7280;
  font-weight:600;
}
.rv-card-summary .rv-summary-value{
  color:#111827;
  font-weight:700;
}

/* Cesantía radios en línea */
.rv-card-summary .rv-summary-value label{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-weight:600;
  color:var(--rv-blue);
}
.rv-card-summary .rv-summary-value input[type="radio"]{
  accent-color:var(--rv-blue);
}

/* Card de métricas con estilo corporativo */
.rv-card-metrics{
  position:relative;
  border-radius:20px;
  padding:22px 24px 24px;
  border:1px solid rgba(148,163,184,0.35);
  background: radial-gradient(circle at top right, rgba(55,127,182,0.05), transparent 55%), #ffffff;
  box-shadow:0 18px 45px rgba(15,23,42,0.05);
}
.rv-card-metrics h3{
  margin-top:0;
  margin-bottom:14px;
  font-size:18px;
  font-weight:800;
  color:#111827;
}
.rv-metric-card{
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease, background-color .15s ease;
}
.rv-metric-card:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 20px rgba(15,23,42,0.08);
  background:#ffffff;
  border-color:rgba(55,127,182,0.5);
}
.rv-metric-label{
  letter-spacing:.01em;
}

.rv-product-comparison{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:12px;
  margin-top:8px;
}
.rv-product-item{
  padding:10px 12px;
  border-radius:12px;
  border:1px dashed var(--rv-blue-light);
  background:#f9fafb;
  cursor:pointer;
  position:relative;
}
.rv-product-item:hover{border-style:solid;background:#f3f7ff}
.rv-product-item.is-selected{border:2px solid var(--rv-blue);background:#eef6ff;box-shadow:0 6px 18px rgba(23,105,162,.12)}
.rv-product-hint{margin-top:6px;font-size:11px;color:#6b7280}
.rv-product-name{
  font-size:13px;
  font-weight:700;
  color:var(--rv-blue);
}
.rv-product-value{
  margin-top:4px;
  font-size:16px;
  font-weight:800;
  color:#111827;
}


/* Técnicos: vista tipo perfil */
.rv-subtitle{margin:0 0 16px;font-size:14px;color:#4b5563}
.rv-grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
@media (max-width:80px){
  .rv-grid-3{grid-template-columns:repeat(2,1fr);}
}
@media (max-width:80px){
  .rv-grid-3{grid-template-columns:1fr;}
}
.rv-card.tech{text-align:center;display:flex;flex-direction:column;align-items:center;gap:8px}
.rv-tech-avatar{width:80px;height:80px;border-radius:9999px;overflow:hidden;margin-bottom:8px;}
.rv-tech-avatar img{width:100%;height:100%;object-fit:cover;}
.rv-card.tech a{font-size:13px;word-break:break-all;}


/* Rol bajo el nombre (Agente / Supervisor) */
.rv-role-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
  margin-bottom: 6px;
}


/* Subtítulo bajo el título de la sección */
.rv-subtitle{
  margin-top:4px;
  margin-bottom:18px;
  font-size:14px;
  color:#6b7280;
}

/* Número de WhatsApp debajo del enlace */
.rv-wa-number{
  margin-top:2px;
  font-size:12px;
  opacity:0.8;
}

/* Conteo de cotizaciones en cards de agentes */
.rv-count-label{
  font-size:13px;
  font-weight:600;
  margin-bottom:4px;
}

.aps-logo{position:fixed;bottom:10px;right:10px;z-index:9999;}
.aps-logo img{width:138px;}


.rv-status-select{
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
}



/* --- Sidebar & navegación moderna con iconos --- */
.rv-nav-group{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.rv-nav-title{
  font-size:17px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:#9ca3af;
  margin:4px 4px 10px;
}

.rv-nav{
  all:unset;
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  cursor:pointer;
  padding:10px 12px;
  border-radius:999px;
  font-weight:700;
  font-size:17px;
  color:#344054;
  transition:background .18s ease, color .18s ease, box-shadow .18s ease, transform .12s ease;
}

.rv-nav-icon{
  width:22px;
  height:22px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(55,127,182,0.07);
  flex-shrink:0;
}

.rv-nav-icon svg{
  width:14px;
  height:14px;
  display:block;
}

.rv-nav-label{
  white-space:nowrap;
  font-size:17px;
  font-weight:700;
}

.rv-nav:hover{
  background:rgba(55,127,182,0.08);
  color:#1f2933;
  box-shadow:0 6px 14px rgba(15,23,42,.06);
  transform:translateY(-1px);
}

.rv-nav.active{
  background:var(--rv-blue);
  color:#ffffff;
  box-shadow:0 10px 25px rgba(55,127,182,.35);
}

.rv-nav.active .rv-nav-icon{
  background:rgba(255,255,255,0.15);
}

.rv-logout{
  margin-top:16px;
  display:inline-flex;
  align-items:center;
  font-size:12px;
  font-weight:700;
  color:#6b7280;
  opacity:.9;
  transition:color .18s ease, opacity .18s ease;
}

.rv-logout:hover{
  color:#111827;
  opacity:1;
}

/* === RV MODERN UI PACK v2025-11 - BRAND SAFE ===
   Mejora visual manteniendo estrictamente la paleta corporativa ya definida:
   - var(--rv-blue)
   - var(--rv-blue-light)
   - var(--rv-bg)
   - blancos y grises neutros existentes.
*/

/* Layout general ligeramente más suave */
.rv-content{
  background: radial-gradient(circle at top left, var(--rv-bg) 0, #ffffff 55%);
}

/* Tarjetas y paneles con look más limpio */
.rv-card,
.rv-panel,
.rv-box,
.rv-step,
.rv-summary-box,
.rv-table-wrapper,
.rv-table-wrap{
  border-radius:16px;
  border:1px solid #e5e7eb;
  background:#ffffff;
  box-shadow:0 8px 22px rgba(15,23,42,0.06);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.rv-card:hover,
.rv-panel:hover,
.rv-box:hover,
.rv-step:hover,
.rv-summary-box:hover{
  transform:translateY(-1px);
  box-shadow:0 14px 30px rgba(15,23,42,0.09);
  border-color:rgba(55,127,182,0.35);
}

/* Sidebar más pulida pero con mismo esquema blanco/azul */
.rv-sidebar{
  border-radius:18px;
  border-right:1px solid #e5e7eb;
  background:linear-gradient(180deg,#ffffff 0,var(--rv-bg) 85%);
  box-shadow:0 14px 32px rgba(15,23,42,0.06);
}

.rv-nav{
  border-radius:999px;
  display:flex;
  align-items:center;
  gap:8px;
  font-size:17px;
}

.rv-nav::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:999px;
  background:transparent;
  transition:background .16s ease, transform .16s ease;
}

.rv-nav.active,
.rv-nav:hover{
  background:var(--rv-blue);
  color:#fff;
}

.rv-nav.active::before,
.rv-nav:hover::before{
  background:var(--rv-blue-light);
  transform:scale(1.1);
}

/* Botones principales en formato píldora, mismo azul corporativo */
.rv-btn{
  border-radius:999px;
  padding:9px 16px;
  font-size:14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  text-decoration:none;
  white-space:nowrap;
  line-height:1;
  height:40px;

  letter-spacing:.01em;
  box-shadow:0 10px 24px rgba(55,127,182,0.45);
  background:var(--rv-blue);
}

.rv-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 14px 32px rgba(55,127,182,0.65);
}

.rv-btn.ghost{
  background:#ffffff;
  color:var(--rv-blue);
  border:2px solid var(--rv-blue);
  box-shadow:0 6px 18px rgba(15,23,42,0.06);
}

/* Tablas más modernas pero con encabezado azul corporativo existente */
.rv-table{
  border-collapse:separate;
  border-spacing:0;
}

.rv-table thead th{background:#32679E!important;color:#fff!important;font-weight:700;}

.rv-table tbody tr{
  transition:background .12s ease, box-shadow .12s ease, transform .08s ease;
}

.rv-table tbody tr:hover{
  background:#f3f6ff;
  box-shadow:0 6px 16px rgba(15,23,42,0.06);
  transform:translateY(-1px);
}

/* Inputs y selects más suaves */
.rv-field input,
.rv-field select,
.rv-field textarea{
  border-radius:12px;
  border:1px solid #e5e7eb;
  transition:border-color .14s ease, box-shadow .14s ease, background .14s ease;
}

.rv-field input:focus,
.rv-field select:focus,
.rv-field textarea:focus{
  outline:none;
  border-color:var(--rv-blue);
  box-shadow:0 0 0 1px rgba(55,127,182,0.32);
  background:#f7fbff;
}


/* Mobile: mantener identidad clara y legible */
@media(max-width:80px){
  .rv-sidebar{
    border-radius:16px;
    box-shadow:0 18px 40px rgba(15,23,42,0.24);
  }

  .rv-card,
  .rv-panel,
  .rv-box,
  .rv-step,
  .rv-summary-box{
    border-radius:16px;
  }
}

/* === RV APP PRELOADER === */
.rv-preloader-overlay{
  position:fixed;
  inset:0;
  background:#f5f9fe;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
  transition:opacity .35s ease, visibility .35s ease;
}
.rv-preloader-inner{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
}
.rv-preloader-logo img{
  max-width:80px;
  height:auto;
  display:block;
}
.rv-preloader-spinner{
  width:38px;
  height:38px;
  border-radius:999px;
  border:3px solid rgba(255,255,255,0.9);
  border-top-color:#32679E;
  border-right-color:#32679E;
  animation:rv-spin 0.8s linear infinite;
  box-shadow:0 0 0 1px rgba(0,0,0,0.02);
}
.rv-preloader-hide{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}

@keyframes rv-spin{
  to{transform:rotate(360deg);}
}



/* === NEUMORPHISM STYLE FOR TECHNICIAN & AGENT CARDS === */
#rv-tecnico .rv-card.tech,
#rv-agentes .rv-card.tech,
#rv-productos .rv-card {
  border-radius: 28px;
  background: #f5f7fa;
  padding: 32px 24px;
  box-shadow:
      -8px -8px 16px rgba(255,255,255,0.9),
      8px 8px 22px rgba(0,0,0,0.08);
  transition: transform .25s ease, box-shadow .25s ease, transform .25s ease;
}

#rv-tecnico .rv-card.tech:hover,
#rv-agentes .rv-card.tech:hover,
#rv-productos .rv-card:hover {
  transform: translateY(-4px);
  box-shadow:
      -10px -10px 20px rgba(255,255,255,0.85),
      10px 10px 28px rgba(0,0,0,0.12);
}

#rv-tecnico .rv-tech-avatar img,
#rv-agentes .rv-tech-avatar img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #32679E;
  box-shadow:
    -4px -4px 8px rgba(255,255,255,0.9),
    4px 4px 12px rgba(0,0,0,0.08);
}

#rv-tecnico .rv-card.tech h4,
#rv-agentes .rv-card.tech h4 {
  margin-top: 18px;
  font-size: 20px;
  font-weight: 700;
  color: #1e2d3d;
}

#rv-tecnico .rv-role-label,
#rv-agentes .rv-role-label {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #65758a;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#rv-tecnico .rv-card.tech a,
#rv-agentes .rv-card.tech a {
  margin-top: 6px;
  font-size: 15px;
  color: #324963;
}

/* === MODERN SECTION TITLES USING PRIMARY COLOR === */
html body .rv-content h1{
  font-size:24px;
  font-weight:800;
  color:#32679E;
  margin:0 0 6px;
  letter-spacing:.02em;
  display:inline-block;
  position:relative;
}

html body .rv-content h1::after{
  content:"";
  display:block;
  width:68px;
  height:3px;
  border-radius:999px;
  background:#32679E;
  margin-top:6px;
}

/* === FIX: Nomina RV table should not overflow horizontally === */
#rv-nomina .rv-table-wrap{
  max-width:100%;
  box-sizing:border-box;
  overflow-x:auto;
  margin-right:0;
}
#rv-nomina .rv-table{
  width:100%;
  table-layout:auto;
}

html body .rv-content{overflow-x:auto;}

/* === MODERN KPI CARDS ON INICIO === */
#rv-kpis{
  margin-top:18px;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:18px;
}

#rv-kpis .rv-card{
  position:relative;
  border-radius:24px;
  padding:20px 22px;
  background:radial-gradient(circle at top left, rgba(50,103,158,0.12), #ffffff 55%);
  box-shadow:
      0 18px 45px rgba(15,23,42,0.08);
  border:1px solid rgba(148,163,184,0.35);
  overflow:hidden;
  transition:transform .22s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease;
}

#rv-kpis .rv-card::before{
  content:"";
  position:absolute;
  right:-40px;
  top:-40px;
  width:120px;
  height:120px;
  border-radius:999px;
  background:rgba(50,103,158,0.18);
  filter:blur(1px);
}

#rv-kpis .rv-card:hover{
  transform:translateY(-3px);
  box-shadow:0 22px 55px rgba(15,23,42,0.14);
  border-color:rgba(50,103,158,0.55);
}

/* Title (first line) */
#rv-kpis .rv-card > :first-child{
  font-size:16px;
  font-weight:700;
  color:#1f2937;
}

/* Value (second line) */
#rv-kpis .rv-card > :last-child{
  margin-top:10px;
  font-size:30px;
  font-weight:800;
  color:#32679E;
}


/* === USER CARD HORIZONTAL PRO (AVATAR GLOW) === */
.rv-user-card{
  display:flex;
  align-items:center;
  gap:18px;
  padding:20px 28px;
  background:#f5f7fa;
  border-radius:28px;
  box-shadow:
    -8px -8px 16px rgba(255,255,255,0.9),
    8px 8px 22px rgba(0,0,0,0.08);
  transition:transform .22s ease, box-shadow .22s ease;
}

.rv-user-card:hover{
  transform:translateY(-3px);
  box-shadow:
    -10px -10px 20px rgba(255,255,255,0.85),
    10px 10px 28px rgba(0,0,0,0.12);
}

.rv-user-card .rv-user-avatar img{
  width:70px;
  height:70px;
  border-radius:50%;
  object-fit:cover;
  border:2px solid #32679E;
  box-shadow:
    0 0 0 4px rgba(50,103,158,0.15),
    0 4px 10px rgba(0,0,0,0.12),
    -4px -4px 8px rgba(255,255,255,0.9);
}

.rv-user-card .rv-user-info .name{
  font-size:18px;
  font-weight:600;
  color:#324963;
}

.rv-user-card .rv-user-info .code{
  font-size:14px;
  color:#55616f;
  letter-spacing:0.5px;
  margin-top:3px;
}
/* END USER CARD HORIZONTAL PRO */

/* === KPI CARDS PRIMARY THEME (#32679E, white text) === */
#rv-kpis{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:16px;
}

#rv-kpis .rv-card{
  position:relative;
  background:#32679E !important;
  border-radius:28px;
  padding:22px 22px 20px;
  color:#ffffff !important;
  box-shadow:
    -6px -6px 12px rgba(255,255,255,0.18),
    8px 14px 24px rgba(15,23,42,0.22);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}

#rv-kpis .rv-card::before{
  content:"";
  position:absolute;
  width:220px;
  height:220px;
  border-radius:50%;
  background:rgba(255,255,255,0.10);
  top:-80px;
  right:-80px;
}

#rv-kpis .rv-card > *:first-child{
  font-size:18px;
  font-weight:700;
  color:#ffffff !important;
}

#rv-kpis .rv-card > *:last-child{
  margin-top:12px;
  font-size:32px;
  font-weight:800;
  color:#ffffff !important;
}

/* === INICIO: Modern chart + agent card layout using primary color === */
.rv-chart-wrap{
  max-width:100%;
  background:radial-gradient(circle at top left,#f5f9ff 0,#ffffff 42%,#f3f6fb 100%);
  border-radius:28px;
  padding:22px 24px 26px;
  box-shadow:0 18px 40px rgba(15,23,42,0.08);
}

.rv-inicio-grid{
  display:grid;
  grid-template-columns:minmax(0,1.5fr) minmax(0,320px);
  gap:24px;
  align-items:stretch;
}

.rv-inicio-left > canvas{
  display:block;
  width:100% !important;
  height:260px !important;
}

/* Agent card at top-right */
.rv-agent-card{
  border-radius:24px;
  background:#f5f7fa;
  padding:20px 22px;
  box-shadow:
    -8px -8px 16px rgba(255,255,255,0.9),
    8px 8px 22px rgba(15,23,42,0.16);
  display:flex;
  align-items:center;
  gap:16px;
}

.rv-agent-head{
  margin:0;
}

.rv-agent-head img{
  width:70px;
  height:70px;
  border-radius:50%;
  object-fit:cover;
  border:2px solid #32679E;
  box-shadow:
    0 0 0 4px rgba(50,103,158,0.15),
    0 4px 10px rgba(0,0,0,0.12),
    -4px -4px 8px rgba(255,255,255,0.9);
}

.rv-agent-name{
  font-size:18px;
  font-weight:600;
  color:#324963;
}

.rv-agent-code{
  font-size:13px;
  font-weight:600;
  color:#6b7280;
}

/* Responsive */
@media (max-width:960px){
  .rv-chart-wrap{
    padding:16px 14px 18px;
    border-radius:22px;
  }
  .rv-inicio-grid{
    grid-template-columns:1fr;
    gap:16px;
  }
}



/* Supervisores & equipos */
.rv-supervisores-grid{
  gap:20px;
  align-items:flex-start;
}
.rv-supervisor-card{
  border-radius:20px;
  padding:16px 18px 18px;
  background:#ffffff;
  box-shadow:-8px -8px 18px rgba(255,255,255,0.9),12px 18px 32px rgba(15,23,42,0.12);
  border:1px solid #e5e7eb;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.rv-supervisor-header{
  display:flex;
  align-items:center;
  gap:14px;
  border-bottom:1px dashed #e5e7eb;
  padding-bottom:10px;
}
.rv-supervisor-avatar{
  width:42px;
  height:42px;
  border-radius:999px;
  background:radial-gradient(circle at 30% 20%, #fff, #32679E);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-weight:700;
  font-size:18px;
  flex-shrink:0;
  box-shadow:0 8px 16px rgba(50,103,158,0.35);
}
.rv-supervisor-meta h3{
  font-size:15px;
  margin:0;
  color:#111827;
}
.rv-supervisor-meta p{
  margin:2px 0;
  font-size:12px;
  color:#6b7280;
}
.rv-supervisor-meta a{
  font-size:11px;
  color:#32679E;
  text-decoration:none;
}
.rv-supervisor-meta a:hover{
  text-decoration:underline;
}
.rv-supervisor-kpi{
  margin-left:auto;
  text-align:right;
  font-size:11px;
  color:#6b7280;
}
.rv-supervisor-count{
  display:block;
  font-size:18px;
  font-weight:700;
  color:#32679E;
  line-height:1.1;
}
.rv-supervisor-body{
  display:grid;
  grid-template-columns: minmax(0,1.2fr) minmax(0,1fr);
  gap:14px;
}
.rv-supervisor-column h4{
  margin:0 0 8px;
  font-size:13px;
  color:#111827;
}
.rv-supervisor-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:6px;
  max-height:260px;
  overflow:auto;
}
.rv-supervisor-agent{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 8px;
  border-radius:999px;
  background:#f3f4f6;
}
.rv-agent-initial{
  width:26px;
  height:26px;
  border-radius:999px;
  background:#32679E;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:13px;
  font-weight:600;
  flex-shrink:0;
}
.rv-agent-info{
  display:flex;
  flex-direction:column;
  gap:1px;
  font-size:11px;
  flex:1;
}
.rv-agent-info strong{
  font-size:12px;
  color:#111827;
}
.rv-supervisor-form{
  margin-left:auto;
}
.rv-supervisor-form .rv-btn.small,
.rv-supervisor-form-inline .rv-btn.small{
  font-size:11px;
  padding:4px 10px;
  border-radius:999px;
}
.rv-supervisor-form-inline{
  display:flex;
  align-items:center;
  gap:6px;
  margin-top:4px;
}
.rv-supervisor-form-inline select{
  min-width:180px;
  border-radius:999px;
  border:1px solid #d1d5db;
  padding:5px 10px;
  font-size:12px;
}
.rv-empty{
  font-size:12px;
  color:#6b7280;
  margin:6px 0 0;
}
@media (max-width:900px){
  .rv-supervisor-body{
    grid-template-columns:minmax(0,1fr);
  }
}


@media print {
  .rv-metric-card.rv-print-hide { display: none !important; }
}


/* === APS Sidebar Style (SAFE OVERRIDES) ===
   Only affects the sidebar menu visuals. Does NOT touch app logic or forms.
*/
.rv-sidebar{
  /* Wider sidebar so labels like "Mis Cotizaciones" never clip */
  width:340px;
  background:linear-gradient(180deg,#ffffff 0%, #f2f8ff 100%);
  border-right:none;
  border-radius:26px;
  padding:22px 20px;
  box-shadow:0 18px 45px rgba(15,23,42,.10);
}
.rv-logo{justify-content:center;margin:8px 0 18px;}
.rv-logo img{height:64px}
.rv-sidebar nav{gap:10px}

.rv-nav-title{display:none !important;}

.rv-nav{
  all:unset;
  display:flex;
  align-items:center;
  gap:16px;
  width:100%;
  cursor:pointer;
  padding:14px 16px;
  border-radius:999px;
  font-weight:800;
  font-size:18px;
  color:#111827;
  background:transparent;
  transition:background .18s ease, color .18s ease, box-shadow .18s ease, transform .12s ease;
}
.rv-nav:active{transform:scale(.99)}
.rv-nav-icon{
  width:54px;height:54px;border-radius:999px;
  display:flex;align-items:center;justify-content:center;
  background:#EEF2F7;flex-shrink:0;color:#0F3B5F;
}
.rv-nav-icon svg{width:24px;height:24px;display:block}
.rv-nav-label{
  white-space:nowrap;
  font-size:18px;line-height:1;
  /* ensure label can shrink a hair on very narrow screens */
  max-width:100%;
}
.rv-nav.active, .rv-nav:hover{
  background:#1769A2;
  color:#fff;
  box-shadow:0 16px 30px rgba(23,105,162,.22);
}
.rv-nav.active .rv-nav-icon, .rv-nav:hover .rv-nav-icon{
  background:rgba(255,255,255,.18);
  color:#fff;
}

/* Reduce vertical spacing a bit */
.rv-sidebar nav{gap:6px}

@media (max-width:420px){
  .rv-sidebar{width:310px;padding:20px 18px;}
  .rv-nav{font-size:17px;padding:13px 14px;gap:14px;}
  .rv-nav-label{font-size:17px;}
}



/* Normalize action buttons inside tables */
.rv-table .row-actions{flex-wrap:nowrap;align-items:center}
.rv-table .row-actions .rv-btn{height:36px;padding:8px 14px;font-size:13px}
.rv-table td{vertical-align:middle}

/* ===========================
   Calculadora Préstamo (CP)
   Estilo APS (grid moderno)
   =========================== */
.cp-wrap{width:100%;}
.cp-grid{display:grid;grid-template-columns:1fr;gap:14px;margin-top:10px;}
@media(min-width:980px){.cp-grid{grid-template-columns:520px 1fr;}}
.cp-card{background:#fff;border:1px solid rgba(0,0,0,.08);border-radius:16px;padding:14px;box-shadow:0 10px 30px rgba(0,0,0,.04);}
.cp-row{display:grid;grid-template-columns:1fr;gap:12px;}
@media(min-width:640px){.cp-row{grid-template-columns:1fr 1fr;}}
.cp-field{display:flex;flex-direction:column;gap:6px;margin-bottom:10px;}
.cp-field label{font-weight:800;font-size:12.5px;color:#27385A;}
.cp-field input{border:1px solid rgba(0,0,0,.14);border-radius:12px;padding:10px 12px;font-size:14px;outline:none;background:#fff;}
.cp-field input[readonly]{background:rgba(23,105,162,.06);border-color:rgba(23,105,162,.18);}
.cp-field input:focus{border-color:rgba(23,105,162,.55);box-shadow:0 0 0 3px rgba(23,105,162,.12);}
.cp-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:6px;}
.cp-kpis{display:grid;grid-template-columns:1fr;gap:10px;margin-bottom:12px;}
@media(min-width:720px){.cp-kpis{grid-template-columns:repeat(3,1fr);}}
.cp-kpi{border:1px solid rgba(0,0,0,.08);border-radius:14px;padding:12px;background:linear-gradient(180deg, rgba(23,105,162,.06), rgba(255,255,255,0));}
.cp-kpi-label{font-size:12px;opacity:.75;}
.cp-kpi-value{font-size:18px;font-weight:900;margin-top:6px;word-break:break-word;}
.cp-table-wrap{overflow:auto;border:1px solid rgba(0,0,0,.08);border-radius:14px;}
.cp-table{width:100%;border-collapse:collapse;min-width:820px;}
.cp-table th,.cp-table td{padding:10px;border-bottom:1px solid rgba(0,0,0,.06);text-align:right;font-size:12.5px;white-space:nowrap;}
.cp-table th:first-child,.cp-table td:first-child{text-align:left;}
.cp-table thead th{position:sticky;top:0;background:#1769A2;color:#fff;font-weight:900;}
.cp-table tbody tr:nth-child(even){background:rgba(23,105,162,.04);}
.cp-meta{border:1px solid rgba(0,0,0,.08);border-radius:12px;padding:10px 12px;font-size:12.5px;background:rgba(0,0,0,.02);}
.cp-meta-k{opacity:.75;font-weight:700;}
.rv-muted{opacity:.75;font-size:13px;}

/* FIX v1.2.6.3: evitar recortes de tabla en Calculadora Prestamo */
#rv-prestamo-card .cp-card{overflow:visible;}
#rv-prestamo-card .cp-table-wrap{max-width:100%; overflow-x:auto; padding-bottom:6px;}
#rv-prestamo-card .cp-table{min-width:760px;}

/* v1.2.6.7: Excluir calculadora de préstamo del PDF principal */
.rv-hide-prestamo #rv-prestamo-card{display:none !important;}
@media print{
  #rv-prestamo-card{display:none !important;}
}

/* v1.2.6.8: Responsivo - evitar que se corten columnas en Calculadora Prestamo */
#rv-prestamo-card .cp-table-wrap{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  padding-right:12px;
}
#rv-prestamo-card .cp-table{
  width:max-content;
  min-width:720px;
}
#rv-prestamo-card .cp-table th,
#rv-prestamo-card .cp-table td{
  padding:8px 10px;
}
#rv-prestamo-card .cp-table th:last-child,
#rv-prestamo-card .cp-table td:last-child{
  padding-right:18px;
}

/* En pantallas/zoom donde el ancho efectivo baja, reducimos un poco tipografía/espaciado */
@media (max-width: 1200px){
  #rv-prestamo-card .cp-grid{grid-template-columns:1fr;}
  #rv-prestamo-card .cp-table{min-width:680px;}
  #rv-prestamo-card .cp-table th,
  #rv-prestamo-card .cp-table td{font-size:12px; padding:7px 8px;}
}
@media (max-width: 980px){
  #rv-prestamo-card .cp-table{min-width:640px;}
  #rv-prestamo-card .cp-table th,
  #rv-prestamo-card .cp-table td{font-size:11.5px; padding:6px 7px;}
}

/* v1.2.6.9: Anti-recorte definitivo (padding + pseudo-scroll + overflow parents) */
#rv-prestamo-card,
#rv-prestamo-card .rv-card,
#rv-prestamo-card .cp-card,
#rv-prestamo-card .cp-grid,
#rv-prestamo-card .cp-right,
#rv-prestamo-card .cp-left{
  overflow: visible !important;
}

#rv-prestamo-card .cp-right{min-width:0;}
#rv-prestamo-card .cp-table-wrap{
  width:100%;
  display:block;
  overflow-x:auto !important;
  overflow-y:hidden;
  padding-right:24px; /* espacio para que no “pegue” al borde */
  box-sizing:border-box;
}

/* crea un pequeño “espacio” al final para que la última columna nunca quede cortada */
#rv-prestamo-card .cp-table-wrap::after{
  content:"";
  display:block;
  width:24px;
  height:1px;
}

#rv-prestamo-card .cp-table{
  width:max-content;
  min-width:760px;
  border-collapse:separate;
  border-spacing:0;
}

/* v1.2.7.0: Contención dentro del box (sin desbordar a los lados) */
#rv-prestamo-card .cp-card{overflow:hidden !important;}
#rv-prestamo-card .cp-grid{
  display:grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}
#rv-prestamo-card .cp-left,
#rv-prestamo-card .cp-right{min-width:0; overflow:hidden;}

#rv-prestamo-card .cp-table-wrap{
  max-width:100%;
  width:100%;
  overflow-x:auto !important;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  box-sizing:border-box;
}
#rv-prestamo-card .cp-table{
  width:100%;
  min-width:0;
  table-layout: fixed;
}
#rv-prestamo-card .cp-table th,
#rv-prestamo-card .cp-table td{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* En pantallas más estrechas, apila en 1 columna para evitar desbordes */
@media (max-width: 1200px){
  #rv-prestamo-card .cp-grid{grid-template-columns: minmax(0,1fr);}
  #rv-prestamo-card .cp-table{table-layout:auto;}
  #rv-prestamo-card .cp-table th,
  #rv-prestamo-card .cp-table td{font-size:12px;}
}



/* =========================
   Premium UI overrides v3
   ========================= */
:root{
  --aps-blue:#1769A3;
  --rv-blue: var(--aps-blue);
  --rv-blue-600:#135a8a;
  --rv-bg:#f4f7fb;
  --rv-surface:#ffffff;
  --rv-border:#e6eaf0;
  --rv-shadow: 0 10px 30px rgba(16,24,40,.08);
  --rv-shadow-soft: 0 6px 18px rgba(16,24,40,.06);
  --rv-radius:18px;
}

.rv-app{
  background: var(--rv-bg);
  border-radius: 20px;
  overflow: hidden;
}

.rv-sidebar{
  width: 290px;
  padding: 18px 14px;
  border-right: 1px solid var(--rv-border);
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(10px);
}

.rv-logo{ margin-bottom: 16px; }
.rv-logo img{ height: 44px; }

.rv-nav{
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 800;
  letter-spacing: .2px;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
}
.rv-nav:hover{
  transform: translateY(-1px);
  box-shadow: var(--rv-shadow-soft);
}
.rv-nav.active{
  background: linear-gradient(180deg, var(--rv-blue), var(--rv-blue-600));
  box-shadow: var(--rv-shadow);
}

.rv-content{
  padding: 0;
  background: radial-gradient(1200px 500px at 20% 0%, rgba(23,105,163,.08), transparent 55%),
              radial-gradient(900px 500px at 95% 10%, rgba(23,105,163,.06), transparent 55%),
              var(--rv-bg);
}

/* Topbar */
.rv-topbar{
  position: sticky;
  top: 0;
  z-index: 20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 18px 20px;
  background: rgba(244,247,251,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rv-border);
}

.rv-topbar-kicker{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  font-weight: 800;
  color: #475467;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.rv-page-title{
  margin: 4px 0 0;
  font-size: 26px;
  line-height: 1.1;
  color: #0b2540;
  font-weight: 900;
}

.rv-userchip{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--rv-surface);
  border: 1px solid var(--rv-border);
  box-shadow: var(--rv-shadow-soft);
}
.rv-userchip-avatar{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
}
.rv-userchip-name{ font-weight: 900; color:#0b2540; line-height:1.1; }
.rv-userchip-sub{ font-size: 12px; color:#667085; font-weight: 700; }

/* Views layout */
.rv-view{
  padding: 18px 20px 26px;
}

.rv-section-title{
  margin: 0 0 14px;
  font-size: 18px;
  color:#0b2540;
  font-weight: 900;
}

/* Cards */
.rv-card, .rv-chart-wrap, .rv-kpi, .rv-agent-card{
  border-radius: var(--rv-radius);
  border: 1px solid var(--rv-border);
  background: var(--rv-surface);
  box-shadow: var(--rv-shadow-soft);
}

.rv-chart-wrap{
  padding: 16px;
}

.rv-inicio-grid{
  gap: 16px;
}

.rv-inicio-left canvas{
  background: transparent;
}

/* KPI cards if present */
.rv-kpi, .rv-kpi-card, .rv-stat-card{
  padding: 18px;
}

.rv-kpi h3, .rv-stat-card h3{
  margin:0 0 10px;
  font-size: 14px;
  color:#475467;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.rv-kpi .rv-kpi-value, .rv-stat-card .rv-value{
  font-size: 34px;
  font-weight: 1000;
  color:#0b2540;
}

/* Buttons */
.rv-btn, .rv-restricted-btn, button.rv-primary{
  border-radius: 14px !important;
  background: linear-gradient(180deg, var(--rv-blue), var(--rv-blue-600)) !important;
  border: 0 !important;
  box-shadow: var(--rv-shadow-soft);
}
.rv-btn:hover, .rv-restricted-btn:hover, button.rv-primary:hover{
  filter: brightness(1.02);
  transform: translateY(-1px);
}

/* Mobile improvements */
@media (max-width: 980px){
  .rv-sidebar{ width: 84vw; max-width: 360px; }
  .rv-topbar{ padding: 14px 14px; }
  .rv-page-title{ font-size: 20px; }
  .rv-view{ padding: 14px 14px 24px; }
}

.rv-table td .rv-btn{padding:8px 12px;border-radius:12px;font-size:13px}
.rv-table td .rv-btn.ghost{background:#f8fafc}
.rv-table td .rv-btn[data-del]{background:#0f4c81}

.rv-stats-toolbar{margin:8px 0 14px}
.rv-stats-toolbar label{font-weight:700;color:#344054;display:flex;gap:10px;align-items:center}
#rv-stats-mode{padding:10px 12px;border-radius:12px;border:1px solid #e5e7eb;background:#fff;font-weight:600}
.rv-chart-wrap{background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:16px;box-shadow:0 10px 30px rgba(16,24,40,.06)}
.rv-inicio-grid{display:grid;grid-template-columns:1.55fr .45fr;gap:16px;align-items:stretch}
.rv-inicio-left{background:linear-gradient(180deg, rgba(50,103,158,.06), rgba(50,103,158,.02));border:1px solid rgba(50,103,158,.12);border-radius:16px;padding:14px}
#rv-status-chart{width:100%!important;max-height:320px!important}
.rv-agent-card{border-radius:16px}
.rv-agent-head{display:flex;gap:12px;align-items:center}
.rv-agent-name{font-weight:800;font-size:16px}
.rv-agent-code{font-weight:700;color:#667085;font-size:13px}



/* === UI Premium v5 Hotfix: sidebar typography + button text visibility === */

/* Sidebar labels too large */
.rv-nav-label,
.rv-sidebar .rv-nav-label,
.rv-sidebar .rv-nav .rv-nav-label{
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: .2px !important;
  line-height: 1.15 !important;
}

/* Reduce vertical rhythm a bit so menu looks lighter */
.rv-sidebar .rv-nav{
  padding: 12px 14px !important;
  gap: 10px !important;
}
.rv-sidebar .rv-nav-icon{
  width: 38px !important;
  height: 38px !important;
}

/* Buttons: ensure text is always visible (avoid low-contrast/opacity states) */
button, .rv-btn, .rv-button, .btn, .button,
a.rv-btn, a.btn, a.button{
  color: #ffffff !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* Ghost / secondary style buttons (if any) */
.rv-btn--ghost, .btn-ghost, .button-ghost,
.rv-btn.secondary, .btn.secondary, .button.secondary,
.rv-btn--secondary, .btn-secondary, .button-secondary{
  color: #0f2f4a !important;
  background: #ffffff !important;
  border: 1px solid rgba(15,47,74,.18) !important;
}

/* Disabled buttons should still show label, just dim background */
button:disabled, .rv-btn:disabled, .btn:disabled, .button:disabled,
button[disabled], .rv-btn[disabled], .btn[disabled], .button[disabled]{
  opacity: .55 !important;
  cursor: not-allowed !important;
  filter: grayscale(.15);
}

/* Table action buttons that looked empty */
.rv-table .rv-actions button,
.rv-table .rv-actions .rv-btn,
.rv-table td .rv-btn,
.rv-table td button{
  min-width: 74px;
  padding: 10px 14px !important;
  font-weight: 800 !important;
  letter-spacing: .2px !important;
}

/* Keep header buttons readable */
.rv-page-actions .rv-btn,
.rv-page-actions button{
  font-weight: 800 !important;
}

/* Improve contrast for dark buttons inside light cards */
.rv-card button, .rv-card .rv-btn, .rv-card .btn{
  opacity: 1 !important;
}

/* Tiny fix for "Filtrar" / "+ Nuevo" alignment */
.rv-filter-bar, .rv-page-actions{
  display: flex;
  gap: 10px;
  align-items: center;
}



/* === UI Premium v6 Fix: sidebar labels always visible === */
.rv-sidebar .rv-nav-label,
.rv-nav .rv-nav-label,
.rv-nav-label{
  color:#243044 !important;
  opacity:1 !important;
  visibility:visible !important;
  -webkit-text-fill-color:#243044 !important;
}

/* Ensure inactive items keep readable color */
.rv-sidebar .rv-nav:not(.active){
  color:#243044 !important;
}
.rv-sidebar .rv-nav:not(.active) .rv-nav-icon{
  color:#0F3B5F !important;
}

/* On hover/active keep white */
.rv-sidebar .rv-nav:hover,
.rv-sidebar .rv-nav.active{
  color:#ffffff !important;
}
.rv-sidebar .rv-nav:hover .rv-nav-label,
.rv-sidebar .rv-nav.active .rv-nav-label{
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}



/* === UI v10: spacing between logo and menu === */
.rv-sidebar .rv-logo,
.rv-sidebar .rv-brand,
.rv-sidebar .rv-sidebar-header{
    margin-bottom: 28px !important; /* more breathing room */
    padding-bottom: 6px;
}

.rv-sidebar .rv-nav-group{
    margin-top: 8px !important;
}



/* === FIX ESPACIADO FORM (evita textos pegados a los bordes) === */
#rv-form.rv-view.show{
  padding: 22px 22px 26px !important;
}

/* Si el theme envuelve el shortcode en un contenedor sin padding,
   al menos asegura respiración en el formulario */
#rv-cotizador{
  padding: 0 !important; /* dejamos el padding al #rv-form para no duplicar */
}

/* Stepper: más respiración lateral */
.rv-step-header{
  padding: 14px 18px !important;
  margin: 6px 0 18px !important;
}

/* === FINTECH LOOK (Form Card + Spacing) === */
#rv-form.rv-view.show{ 
  padding: 18px 18px 26px !important; /* outer breathing room */
}

/* Make the form itself the white card so content never touches edges */
#rv-form #rv-cotizador{
  background:#fff !important;
  /* UI Fintech: sin borde visible (solo sombra suave) */
  border: none !important;
  border-radius: 22px !important;
  padding: 22px 22px 26px !important;
  box-shadow: 0 18px 50px rgba(16,24,40,.08) !important;
}

/* Stepper aligns with the card padding */
#rv-form .rv-step-header{
  margin: 2px 0 18px !important;
  padding: 12px 6px 6px !important; /* inside card: avoid double padding */
}
#rv-form .rv-step-header::before{
  left: 6px !important;
  right: 6px !important;
}

/* Fields spacing like modern financial apps */
#rv-form .rv-field{ margin-bottom: 14px !important; }
#rv-form .rv-field label{ 
  font-weight: 800 !important;
  color:#1f3b57 !important;
  margin-bottom: 8px !important;
}
#rv-form input, #rv-form select, #rv-form textarea{
  border-radius: 14px !important;
  border: 1px solid rgba(16,24,40,.12) !important;
  background: #fff !important;
  padding: 12px 14px !important;
  font-weight: 650 !important;
}
#rv-form input:focus, #rv-form select:focus, #rv-form textarea:focus{
  outline: none !important;
  border-color: rgba(50,103,158,.55) !important;
  box-shadow: 0 0 0 4px rgba(50,103,158,.12) !important;
}

/* Buttons feel native */
#rv-form .rv-actions{ 
  margin-top: 14px !important; 
  gap: 12px !important;
}
#rv-form .rv-btn{ 
  padding: 12px 16px !important;
  border-radius: 16px !important;
}

/* Mobile: more inner padding + safe bottom space */
@media (max-width: 640px){
  #rv-form.rv-view.show{ padding: 12px 12px 22px !important; }
  #rv-form #rv-cotizador{ padding: 18px 16px 22px !important; border-radius: 20px !important; border:none !important; }
  #rv-form .rv-actions{ flex-direction: column !important; align-items: stretch !important; }
  #rv-form .rv-btn{ width: 100% !important; }
}
