:root{
  --bg1:#0a3c66;
  --bg2:#0b2947;
  --red:#cc0000;
  --text:#0c1b2a;
  --muted:#6a7a8a;
  --line:#d7dee6;
  --card:#ffffff;
  --w-ur: 150px;
  --w-ur-root: 110px;
  --w-small: 80px; /* 90px como pediste */;
  --title-h: 40px;
  --font: "Arial Nova Cond", "Arial Narrow", Arial, sans-serif;
}

*{box-sizing:border-box;}
html,body{height:100%; margin:0;}
body{
  font-family: var(--font);
  background: radial-gradient(1200px 700px at 30% 10%, #1b6cb3 0%, transparent 60%),
              linear-gradient(135deg, var(--bg1), var(--bg2));
  color: var(--text);
}

.app{
  height:100%;
  display:flex;
  flex-direction:column;
}

.topbar{
  display:flex;
  flex-direction:column;
  gap: 10px;
  padding: 14px 18px 10px 18px;
  color:#fff;
}

.topbarRow1{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
}

.brand-title{
  font-size:34px;
  font-weight:800;
  letter-spacing:0.3px;
}
.brand-title .lightText{font-weight:400;}
.brand-sub{margin-top:2px; font-size:14px; opacity:0.9;}

.logos{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap: 18px;
  flex-wrap:nowrap;
}
.logoItem{display:flex; align-items:center; gap:10px;}
.logoImg{
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  padding: 3px;
}
.logoText{
  color:#eaf4ff;
  font-size:18px;
  font-weight:800;
  letter-spacing:0.2px;
  white-space:nowrap;
}
.logoText .lightText{font-weight:400;}

.topbarRow2{width:100%;}
.controls{
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items:center;
}
.btn{
  height:44px;
  border-radius:999px;
  border:3px solid var(--red);
  background: #ffffff;
  color: var(--red);
  font-size:16px;
  font-weight:900;
  cursor:pointer;
}
.btn.primary{
  background: var(--red);
  color:#ffffff;
}
.btn.icon{font-size:22px; font-weight:900;}
.btn:active{transform: translateY(1px);}
.pill{
  height:44px;
  padding: 0 16px;
  border-radius:999px;
  background: rgba(0,0,0,0.35);
  border:2px solid rgba(255,255,255,0.18);
  color:#fff;
  font-weight:800;
  display:flex;
  align-items:center;
  justify-content:center;
}

.panel{
  margin: 0 16px 10px 16px;
  background: rgba(255,255,255,0.86);
  border-radius: 14px;
  overflow:hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.titlebar{height:46px; display:grid; align-items:center; padding:0 18px; background:var(--red); color:#fff; border-top-left-radius:18px; border-top-right-radius:18px;}

/* filas */
.row{min-height:46px; padding:10px 18px; border-bottom:1px solid rgba(20,40,60,.15); column-gap:6px;}
.row:last-child{border-bottom:none;}

/* Promotor: renglón superior blanco */
#promoterRow{ background:#fff; }

/* grids dinámicos */



.cell{
  padding: 0 8px;
  overflow:hidden;
}

.ur{
  font-weight:800; /* UR en negritas */
  color:#0b4ea2;
  text-decoration: none;
  cursor:pointer;
  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.name{
  font-weight:600;
  color:#111;
  line-height: 1.1;
}

.name-info{ color:#0b4ea2; }

.name.link{color:#0b4ea2; cursor:pointer; text-decoration:none;}



.bar{
  width: 92%;
  height: 12px;
  background: #eef3f8;
  border-radius: 10px;
  overflow:hidden;
  border: 1px solid #d2dbe6;
}
.bar > div{
  height:100%;
  width:0%;
  background: #1aa34a;
}

.count{font-size:14px; font-weight:800; color:#000;}

/* LIST SCROLL */
.panel-list{flex:1; display:flex; flex-direction:column; min-height:0;}
.list{
  flex:1;
  min-height:0;
  overflow-y:auto;
  scrollbar-gutter: stable;
  background:#fff;
}

.status{
  position: fixed;
  left: 18px;
  bottom: 12px;
  right: 18px;
  padding: 10px 12px;
  font-size: 13px;
  color: #fff;
  background: rgba(0,0,0,0.35);
  border-radius: 12px;
  display:none;
}

/* compact on small screens */
@media (max-width: 980px){
  :root{ --w-ur: 190px; }
  .brand-title{font-size: 28px;}
}


/* ---------------------------------------------------------
   Compatibilidad de clases (HTML nuevo vs CSS antiguo)
   --------------------------------------------------------- */

.topbar-row-1{ /* alias de .topbarRow1 */
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
}
.topbar-row-2{ width:100%; }

/* Brand light span */
.brand-title .light{ font-weight:400; }

/* Logos: soporta .logo-item/.logo-img/.logo-text (HTML) y .logoItem/.logoImg/.logoText (CSS viejo) */
.logo-item, .logoItem{ display:flex; align-items:center; gap: 8px; }
.logo-img, .logoImg{
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  padding: 2px;
}
.logo-text, .logoText{
  color:#eaf4ff;
  font-size:18px;
  font-weight:800;
  letter-spacing:0.2px;
  white-space:nowrap;
}
.logo-text .light, .logoText .lightText{ font-weight:400; }
.logo-text-main{ font-weight:900; }
.logo-reg{ font-size: 12px; vertical-align: super; opacity: 0.85; }

/* Root width (UR mas angosta en nivel QROO) */
.root{ --w-ur: var(--w-ur-root); }

/* ---------------------------------------------------------
   Modal / Popups
   --------------------------------------------------------- */

.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 999;
}

/* IMPORTANT: respetar el atributo HTML [hidden] (si no, el modal tapa todo) */
.modal-backdrop[hidden]{
  display: none !important;
}

.modal{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal[hidden]{
  display: none !important;
}

.modal-card{
  /* 20% menos ancho aprox (antes 96vw) */
  width: min(520px, 78vw);
  max-height: 86vh;
  overflow: hidden;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.45);
}

.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 14px;
  background: var(--red);
  color: #fff;
}

.modal-title{
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.3px;
}

.modal-close{
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.12);
  color:#fff;
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
}

.modal-close:active{ transform: translateY(1px); }

.modal-body{
  padding: 14px 14px 16px 14px;
  overflow: auto;
  max-height: calc(86vh - 64px);
  color: #0c1b2a;
  font-size: 15px;
}

.modal-row{ display:flex; gap:12px; align-items:flex-start; }
.modal-img{
  width: 140px;
  height: 170px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid #e5edf5;
  background: #f4f7fb;
}

/* Selfie en popup PERSONA (30 x 38 mm) */
.modal-img-id{
  width: 30mm;
  height: 38mm;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid #e5edf5;
  background: #f4f7fb;
}

.tel-link{
  color: #0b3b66;
  text-decoration: underline;
  font-weight: 900;
}

.modal-divider{ height:1px; background:#e6eef6; margin: 12px 0; }

.modal-kv{
  display:grid;
  grid-template-columns: 150px 1fr;
  gap: 6px 10px;
  align-items: start;
}

.modal-kv .k{
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
}

.modal-kv .v{
  font-weight: 700;
  color: #0c1b2a;
  word-break: break-word;
}

.badge{
  display:inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef3f8;
  border: 1px solid #d2dbe6;
  color: #0c1b2a;
  font-weight: 900;
  font-size: 12px;
}


.muted{ color: var(--muted); font-weight: 800; }
.addr{ font-weight: 900; font-size: 16px; line-height: 1.2; }


/* Metric cell with progress bar */



.metric .bar > i{
  display:block;
  height:100%;
  width:0%;
  background: rgba(204,0,0,.55);
}

/* Grid variants */
.grid4{display:grid; grid-template-columns: 1fr 2fr 1fr 2fr; column-gap:10px; align-items:center;}
.grid5{display:grid; grid-template-columns: 1fr 2fr 80px 80px 80px; column-gap:6px; align-items:center;}
.grid4split{display:grid; grid-template-columns: 1fr 2fr 80px 80px; column-gap:6px; align-items:center;}


.grid4rgsplit{display:grid; grid-template-columns: 1fr 2fr 1fr 2fr; column-gap:10px; align-items:center;}


/* ---- Metrics ---- */
.metric{width:80px; display:flex; flex-direction:column; align-items:flex-end; gap:4px;}
.metric .bar{width:100%; height:10px; background:#e6edf5; border-radius:999px; overflow:hidden;}
.metric .bar i{display:block; height:100%; background:#1bb35a; border-radius:999px;}
.metric .txt{width:100%; text-align:center; font-size:14px; font-weight:700; color:#1a2733;}
.metric.metric-dash .txt{font-weight:800;}

.respRoot{color:#0b4fb3; font-weight:800; text-decoration:none;}

.promoterRow{background:#fff;}
