:root{--bg:#06151d;--panel:#0b2530;--line:#19414e;--text:#f7fbfc;--muted:#91a8b1;--teal:#19d3bf;--blue:#27aee9;--gold:#ffc23b;--green:#3cdda0;--red:#ff7180}*{box-sizing:border-box}html,body{margin:0;height:100%;background:radial-gradient(circle at 50% -20%,#123745 0,#06151d 48%,#041016 100%);color:var(--text);font-family:Inter,Segoe UI,Arial,sans-serif}body{overflow:hidden}.tv-dashboard{width:min(1920px,100%);height:100vh;margin:auto;padding:clamp(10px,1vw,18px);display:flex;flex-direction:column;gap:clamp(8px,.7vw,12px)}.topbar{display:grid;grid-template-columns:210px 1fr 360px;align-items:center;gap:18px;min-height:92px}.logo{width:100%;max-width:205px;max-height:76px;object-fit:contain;object-position:left center}.title-block{text-align:center}.eyebrow{font-size:clamp(10px,.7vw,13px);font-weight:900;letter-spacing:.16em;color:var(--teal)}h1{margin:4px 0 2px;font-size:clamp(26px,2vw,39px);line-height:1;font-weight:950}.period-label{color:var(--muted);font-size:clamp(12px,.82vw,16px);text-transform:capitalize}.country-block{display:grid;grid-template-columns:128px 1fr auto;align-items:center;gap:12px;text-align:left}.country-flag{width:128px;height:78px;border-radius:10px;object-fit:cover;border:3px solid #fff;box-shadow:0 8px 24px #0007}.country-block strong{font-size:21px;letter-spacing:.12em}.clock{font-size:31px;font-weight:950;line-height:1}.date-label{margin-top:3px;color:var(--muted);font-size:11px;text-transform:capitalize}.country-block button{align-self:end;border:0;border-radius:8px;padding:7px 10px;background:var(--teal);color:#04221e;font-weight:900;cursor:pointer;font-size:11px}.kpi-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.kpi{position:relative;min-height:98px;padding:13px 17px;border:1px solid var(--line);border-radius:14px;background:linear-gradient(145deg,rgba(16,49,61,.98),rgba(7,28,37,.98));overflow:hidden}.kpi:after{content:"";position:absolute;right:-25px;top:-42px;width:110px;height:110px;border-radius:50%;background:var(--accent);opacity:.13}.kpi-label{font-size:12px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.kpi-value{margin-top:7px;font-size:clamp(28px,2vw,39px);font-weight:950;line-height:1;white-space:nowrap}.kpi-note{margin-top:5px;color:var(--muted);font-size:11px}.results-panel{flex:1;min-height:0;border:1px solid var(--line);border-radius:16px;background:linear-gradient(180deg,rgba(11,37,48,.96),rgba(5,22,30,.96));padding:11px 14px;display:flex;flex-direction:column}.section-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:15px;margin-bottom:8px}.section-kicker{color:var(--teal);font-size:10px;font-weight:900;letter-spacing:.14em}.section-heading h2{margin:1px 0 0;font-size:21px}.update-status{color:var(--muted);font-size:11px;text-align:right}.team-groups{flex:1;min-height:0;display:grid;grid-template-rows:repeat(2,minmax(0,1fr));gap:9px}.team-group{min-height:0;display:grid;grid-template-columns:190px 1fr;gap:10px;padding:8px;border:1px solid rgba(25,211,191,.24);border-radius:13px;background:rgba(4,17,23,.28)}.team-group.support{border-color:rgba(39,174,233,.26)}.group-title{display:flex;align-items:center;gap:10px;padding:8px}.group-title>span{width:45px;height:45px;border-radius:50%;display:grid;place-items:center;background:rgba(25,211,191,.15);color:var(--teal);font-weight:950;font-size:17px}.support .group-title>span{background:rgba(39,174,233,.14);color:var(--blue)}.group-title strong{display:block;font-size:20px}.group-title small{display:block;color:var(--muted);font-size:10px;margin-top:3px}.seller-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;min-height:0}.seller-card{min-width:0;height:100%;border:1px solid var(--line);border-radius:13px;background:linear-gradient(150deg,#0d2a36,#071b24);padding:9px;display:grid;grid-template-columns:clamp(92px,6.3vw,120px) 1fr;gap:10px;align-items:center}.seller-photo-wrap{position:relative}.seller-photo{width:100%;aspect-ratio:1/1;border-radius:13px;object-fit:cover;object-position:center top;border:3px solid var(--teal);background:#102d38}.support .seller-photo{border-color:var(--blue)}.rank{position:absolute;left:-7px;top:-8px;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:#40515a;color:#fff;font-weight:950;border:3px solid #0b2530;font-size:14px}.rank-1{background:#ffd34f;color:#342500}.rank-2{background:#d9e2e8;color:#23313a}.rank-3{background:#d8955b;color:#2d1908}.seller-content{min-width:0}.seller-name{font-size:clamp(16px,1.02vw,21px);font-weight:950;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:7px}.metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}.metric{border:1px solid rgba(255,255,255,.065);background:rgba(1,13,18,.32);border-radius:7px;padding:5px 6px;min-width:0}.metric-label{display:block;color:var(--muted);font-size:8px;font-weight:850;text-transform:uppercase;white-space:nowrap}.metric strong{display:block;margin-top:2px;font-size:clamp(12px,.78vw,16px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.metric.collection strong{color:var(--blue)}.metric.today strong{color:var(--gold)}.empty-state{margin:auto;text-align:center;color:var(--muted);font-size:20px}.error-message{border:1px solid var(--red);background:rgba(255,113,128,.12);color:#ffd8dc;padding:10px;border-radius:9px}footer{text-align:center;color:var(--muted);font-size:9px}button:disabled{opacity:.55;cursor:wait}@media(max-width:1250px){.topbar{grid-template-columns:150px 1fr 300px}.country-flag{width:105px;height:66px}.country-block{grid-template-columns:105px 1fr auto}.team-group{grid-template-columns:150px 1fr}.seller-card{grid-template-columns:82px 1fr}.group-title strong{font-size:17px}.metric strong{font-size:12px}}@media(max-width:900px){body{overflow:auto}.tv-dashboard{height:auto;min-height:100vh}.topbar{grid-template-columns:100px 1fr}.country-block{grid-column:1/-1;justify-self:center}.kpi-grid{grid-template-columns:repeat(2,1fr)}.team-groups{grid-template-rows:auto}.team-group{grid-template-columns:1fr}.seller-grid{grid-template-columns:repeat(2,1fr)}}

/* ===== Ajustes finales aprobados para TV ===== */

/* tv-max-size-overrides */

/* Vista TV: máximo tamaño útil y cuadrícula adaptable por cantidad de vendedores */
.tv-dashboard{padding:8px 12px;gap:7px}
.topbar{grid-template-columns:190px 1fr 390px;min-height:84px;gap:14px}
.logo{max-width:190px;max-height:68px}
.country-flag{width:142px;height:82px}
.country-block{grid-template-columns:142px 1fr auto}
.kpi-grid{gap:8px}
.kpi{min-height:88px;padding:10px 15px}
.kpi-label{font-size:13px}
.kpi-value{font-size:clamp(32px,2.3vw,46px)}
.kpi-note{font-size:12px}
.results-panel{padding:8px 10px}
.section-heading{margin-bottom:5px}
.section-heading h2{font-size:20px}
.team-groups{gap:7px}
.team-group{
  display:grid;
  grid-template-columns:1fr;
  grid-template-rows:auto minmax(0,1fr);
  gap:5px;
  padding:6px 8px 8px;
}
.group-title{padding:0 4px;gap:8px;min-height:30px}
.group-title>span{width:30px;height:30px;font-size:13px}
.group-title strong{font-size:18px;display:inline}
.group-title small{display:inline;margin-left:8px;font-size:10px}
.seller-grid{
  --seller-cols:4;
  grid-template-columns:repeat(var(--seller-cols),minmax(0,1fr));
  gap:7px;
  align-items:stretch;
}
.seller-card{
  padding:8px;
  grid-template-columns:minmax(112px,34%) minmax(0,1fr);
  gap:9px;
  border-radius:12px;
}
.seller-photo{height:100%;max-height:168px;aspect-ratio:1/1;object-fit:cover}
.rank{width:39px;height:39px;font-size:17px;left:-6px;top:-7px}
.seller-name{font-size:clamp(19px,1.2vw,25px);margin-bottom:6px;line-height:1.05}
.metrics{gap:5px}
.metric{padding:6px 7px}
.metric-label{font-size:clamp(9px,.55vw,11px)}
.metric strong{font-size:clamp(16px,1.02vw,22px);line-height:1.08}
footer{font-size:8px}

/* Más espacio cuando hay pocos vendedores en un grupo */
.seller-grid[data-count="1"]{--seller-cols:1}
.seller-grid[data-count="2"]{--seller-cols:2}
.seller-grid[data-count="3"]{--seller-cols:3}
.seller-grid[data-count="4"]{--seller-cols:4}
.seller-grid[data-count="5"]{--seller-cols:5}
.seller-grid[data-count="6"]{--seller-cols:6}
.seller-grid[data-count="7"],.seller-grid[data-count="8"]{--seller-cols:4;grid-template-rows:repeat(2,minmax(0,1fr))}

.seller-grid[data-count="1"] .seller-card{grid-template-columns:minmax(180px,25%) 1fr}
.seller-grid[data-count="1"] .seller-photo{max-height:205px}
.seller-grid[data-count="1"] .seller-name{font-size:34px}
.seller-grid[data-count="1"] .metric strong{font-size:28px}
.seller-grid[data-count="2"] .seller-card{grid-template-columns:minmax(150px,31%) 1fr}
.seller-grid[data-count="2"] .seller-photo{max-height:190px}
.seller-grid[data-count="2"] .seller-name{font-size:30px}
.seller-grid[data-count="2"] .metric strong{font-size:24px}
.seller-grid[data-count="3"] .seller-card{grid-template-columns:minmax(130px,34%) 1fr}
.seller-grid[data-count="3"] .seller-name{font-size:26px}
.seller-grid[data-count="3"] .metric strong{font-size:22px}

/* Compactación automática únicamente cuando crece mucho el equipo */
.seller-grid[data-count="5"] .seller-card,
.seller-grid[data-count="6"] .seller-card{grid-template-columns:minmax(82px,31%) 1fr;padding:6px;gap:6px}
.seller-grid[data-count="5"] .seller-name,
.seller-grid[data-count="6"] .seller-name{font-size:17px}
.seller-grid[data-count="5"] .metric strong,
.seller-grid[data-count="6"] .metric strong{font-size:14px}
.seller-grid[data-count="5"] .metric-label,
.seller-grid[data-count="6"] .metric-label{font-size:8px}
.seller-grid[data-count="7"] .seller-card,
.seller-grid[data-count="8"] .seller-card{grid-template-columns:76px 1fr;padding:5px;gap:5px}
.seller-grid[data-count="7"] .seller-name,
.seller-grid[data-count="8"] .seller-name{font-size:15px;margin-bottom:3px}
.seller-grid[data-count="7"] .metric,
.seller-grid[data-count="8"] .metric{padding:3px 4px}
.seller-grid[data-count="7"] .metric strong,
.seller-grid[data-count="8"] .metric strong{font-size:12px}
.seller-grid[data-count="7"] .metric-label,
.seller-grid[data-count="8"] .metric-label{font-size:7px}

@media(max-height:850px){
  .topbar{min-height:70px}.country-flag{width:118px;height:68px}.country-block{grid-template-columns:118px 1fr auto}
  .kpi{min-height:76px}.kpi-value{font-size:32px}.results-panel{padding-top:6px}
  .group-title{min-height:25px}.group-title>span{width:26px;height:26px}.group-title strong{font-size:16px}
  .seller-photo{max-height:140px}.seller-name{font-size:18px}.metric strong{font-size:15px}
}


/* demo-three-two-max */

/* Demo TV 3 vendedores + 2 apoyo: fotografías y cifras al máximo sin scroll */
html,body{overflow:hidden}
.tv-dashboard{height:100vh;min-height:100vh;padding:8px 12px;gap:7px}
.topbar{min-height:82px}
.kpi{min-height:86px}
.results-panel{min-height:0;overflow:hidden;padding:7px 10px}
.team-groups{min-height:0;display:grid;grid-template-rows:1fr 1fr;gap:7px}
.team-group{min-height:0;padding:5px 8px 7px}
.seller-grid{min-height:0;height:100%;gap:10px}
.seller-card{min-height:0;height:100%;padding:10px;grid-template-columns:minmax(145px,38%) minmax(0,1fr);gap:13px;border-radius:15px}
.seller-photo-wrap{height:100%;display:flex;align-items:center}
.seller-photo{width:100%;height:auto;max-height:205px;aspect-ratio:1/1;border-radius:16px;border-width:4px}
.rank{width:46px;height:46px;font-size:21px;border-width:4px}
.seller-name{font-size:clamp(24px,1.55vw,32px);line-height:1.02;margin-bottom:9px}
.metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.metric{padding:8px 9px;border-radius:10px}
.metric-label{font-size:clamp(11px,.72vw,14px);letter-spacing:.02em}
.metric strong{font-size:clamp(22px,1.42vw,30px);line-height:1.05;margin-top:4px;overflow:visible;text-overflow:clip}
.metric.collection strong{font-size:clamp(23px,1.48vw,31px)}
@media (min-width:1500px){
  .seller-card{grid-template-columns:minmax(165px,39%) minmax(0,1fr)}
  .seller-photo{max-height:225px}
  .seller-name{font-size:32px}
  .metric strong{font-size:30px}
  .metric.collection strong{font-size:31px}
}
@media (max-height:850px){
  .topbar{min-height:72px}.kpi{min-height:78px}.seller-photo{max-height:175px}
  .seller-name{font-size:24px}.metric strong{font-size:22px}.metric.collection strong{font-size:23px}
}


/* symmetry-minimal-overrides */

/* Simetría entre ambas divisiones y máximo aprovechamiento de pantalla */
.tv-dashboard{padding:3px 5px;gap:4px}
.topbar{min-height:76px;gap:8px}
.kpi-grid{gap:4px}
.kpi{min-height:78px;padding:8px 11px;border-width:1px;border-radius:8px}
.results-panel{padding:4px 5px;border-width:1px;border-radius:9px}
.section-heading{margin-bottom:3px}
.team-groups{grid-template-rows:minmax(0,1fr) minmax(0,1fr);gap:4px}
.team-group{height:100%;min-height:0;padding:3px 4px 4px;gap:3px;border-width:1px;border-radius:7px}
.group-title{min-height:25px;padding:0 2px}
.group-title>span{width:25px;height:25px;font-size:11px}
.group-title strong{font-size:17px}
.seller-grid{height:100%;min-height:0;grid-template-columns:repeat(var(--shared-cols,3),minmax(0,1fr))!important;grid-template-rows:minmax(0,1fr)!important;gap:4px}
.seller-card{height:100%;min-height:0;padding:5px;border-width:1px;border-radius:7px;grid-template-columns:minmax(145px,39%) minmax(0,1fr);gap:7px}
.seller-photo{height:100%;max-height:none;border-width:2px;border-radius:7px;aspect-ratio:auto}
.rank{width:36px;height:36px;border-width:2px;left:-3px;top:-4px}
.seller-name{font-size:clamp(24px,1.45vw,31px);margin-bottom:5px}
.metrics{gap:3px}
.metric{padding:5px 6px;border-width:1px;border-radius:5px}
.metric-label{font-size:clamp(9px,.56vw,11px)}
.metric strong{font-size:clamp(20px,1.28vw,27px)}
footer{display:none}
.preview-badge{right:5px;bottom:4px;padding:3px 6px;border-radius:4px}
@media(max-width:1250px){.seller-card{grid-template-columns:minmax(120px,37%) minmax(0,1fr)}.seller-name{font-size:22px}.metric strong{font-size:18px}}


/* exact-reference-lock */

/* Bloqueo visual según la versión de referencia proporcionada */
.seller-card{
  padding:5px !important;
  border:1px solid var(--line) !important;
  border-radius:7px !important;
}
.seller-photo-wrap{
  height:100% !important;
}
.seller-photo{
  width:100% !important;
  height:100% !important;
  max-height:none !important;
  aspect-ratio:auto !important;
  object-fit:cover !important;
  object-position:center top !important;
  border:3px solid var(--teal) !important;
  border-radius:8px !important;
}
.team-group.support .seller-photo{
  border-color:var(--blue) !important;
}
.seller-name{
  font-size:clamp(29px,1.72vw,35px) !important;
  line-height:1.02 !important;
  margin-bottom:7px !important;
}
.metric{
  padding:7px 8px !important;
}
.metric-label{
  font-size:clamp(10px,.62vw,12px) !important;
}
.metric strong,
.metric.collection strong,
.metric.today strong,
.metric.today.collection strong{
  font-size:clamp(25px,1.55vw,32px) !important;
  line-height:1.05 !important;
  margin-top:3px !important;
  overflow:visible !important;
  text-overflow:clip !important;
}
@media (max-height:850px){
  .seller-name{font-size:clamp(27px,1.55vw,32px) !important}
  .metric strong,.metric.collection strong,.metric.today strong,.metric.today.collection strong{font-size:clamp(23px,1.4vw,29px) !important}
}

