:root {
  --bg: #020817;
  --panel: #061b2f;
  --panel2: #071426;
  --line: rgba(56, 189, 248, .26);
  --line2: rgba(56, 189, 248, .42);
  --blue: #38bdf8;
  --blue2: #1596e8;
  --text: #f8fafc;
  --muted: #92b5d1;
  --pink: #ff5573;
  --green: #22c55e;
  --orange: #f6a529;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 800;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 220px;
  background: linear-gradient(180deg, #06213a, #031222);
  border-right: 1px solid rgba(56, 189, 248, .20);
  padding: 28px 14px;
  z-index: 30;
}

.sidebar-logo {
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  border-bottom: 1px solid rgba(141, 177, 206, .20);
}

.sidebar-logo img {
  max-width: 70px;
  max-height: 32px;
  object-fit: contain;
}

.sidebar-nav {
  display: grid;
  gap: 12px;
}

.sidebar-nav a {
  color: #b6c9dd;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 15px 18px;
  font-size: 14px;
  font-weight: 950;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
  color: #fff;
  background: rgba(14, 93, 166, .58);
  border-color: rgba(56, 169, 255, .78);
}

.page {
  margin-left: 220px;
  min-height: 100vh;
  padding: 0 18px 28px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  margin: 0 -18px 14px;
  padding: 10px 18px;
  background: rgba(2, 8, 23, .98);
  border-bottom: 1px solid rgba(56, 189, 248, .25);
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -.05em;
  white-space: nowrap;
}

.timebar {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.quick-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.timebar button,
.timebar input,
.timebar a {
  height: 38px;
  min-height: 38px;
  border-radius: 9px;
  border: 1px solid rgba(56, 189, 248, .34);
  background: rgba(7, 32, 54, .92);
  color: #e8f7ff;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 950;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.timebar button {
  cursor: pointer;
}

.timebar button.active,
.timebar .primary,
.timebar .primary-soft.active {
  border-color: rgba(56, 169, 255, .95);
  background: linear-gradient(180deg, rgba(42, 161, 255, .96), rgba(13, 93, 166, .94));
  color: #fff;
}

.date-field {
  position: relative;
  height: 54px;
  display: flex;
  align-items: flex-end;
  min-width: 150px;
}

.date-field span,
.turnos > span {
  position: absolute;
  top: 0;
  left: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.date-field input {
  width: 150px;
}

.turnos {
  position: relative;
  height: 54px;
  display: flex;
  align-items: flex-end;
  padding-left: 10px;
  border-left: 1px solid rgba(141, 177, 206, .22);
}

.turnos > span {
  left: 10px;
}

.turno-row {
  display: flex;
  gap: 6px;
}

.turno-row label {
  height: 38px;
  min-height: 38px;
  border-radius: 9px;
  border: 1px solid rgba(56, 189, 248, .28);
  background: rgba(5, 25, 43, .92);
  color: #e8f7ff;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.turno-row label.active {
  border-color: rgba(246, 165, 41, .88);
  background: rgba(71, 43, 11, .72);
}

.turno-row input {
  width: 14px;
  height: 14px;
  accent-color: var(--orange);
}

.api-ok {
  gap: 8px;
}

.api-ok::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 14px rgba(34, 197, 94, .7);
}

.api-ok.bad::before {
  background: var(--pink);
}

.page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 18px;
}

.pill {
  color: #e8f7ff;
  border: 1px solid var(--line2);
  background: rgba(7, 32, 54, .74);
  border-radius: 999px;
  padding: 12px 16px;
  text-decoration: none;
  font-weight: 950;
}

.pill.right {
  color: var(--blue);
  letter-spacing: .08em;
}

.panel,
.card,
.summary-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(7, 29, 49, .94), rgba(3, 17, 31, .94));
  border-radius: 17px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.015);
}

.panel {
  padding: 18px;
}

.panel h2 {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 17px;
  font-weight: 950;
  letter-spacing: .08em;
}

.panel h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 950;
}

.control-panel {
  margin-bottom: 16px;
}

.control-grid {
  display: grid;
  grid-template-columns: 1.28fr 1fr 1fr;
  gap: 12px;
  align-items: stretch;
}

.card {
  min-height: 245px;
  padding: 14px;
}

.ratio-card {
  overflow: hidden;
}

.ratio-head,
.sem-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.ratio-title,
.sem-title {
  color: #fff;
  font-size: 15px;
  font-weight: 950;
  text-transform: uppercase;
}

.ratio-main {
  color: var(--blue);
  font-size: 44px;
  line-height: .9;
  font-weight: 950;
  letter-spacing: -.05em;
  white-space: nowrap;
}

.ratio-body {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 14px;
}

.donut {
  --ratio: 0;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #071b2e 0 52%, transparent 53%),
    conic-gradient(var(--pink) calc(var(--ratio) * 1%), #14395a 0);
  box-shadow: inset 0 0 0 15px rgba(20,57,90,.78);
}

.donut strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.donut small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
  text-align: center;
  text-transform: uppercase;
}

.ratio-bars {
  display: grid;
  gap: 11px;
}

.ratio-row {
  display: grid;
  grid-template-columns: 105px 1fr 66px;
  align-items: center;
  gap: 10px;
}

.ratio-row span {
  color: #b9d7ee;
  font-size: 11px;
  font-weight: 900;
}

.track {
  height: 8px;
  border-radius: 999px;
  background: #14395a;
  overflow: hidden;
}

.fill {
  height: 100%;
  min-width: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #39e6d3 0%, #ffc857 54%, var(--pink) 100%);
}

.ratio-row strong {
  text-align: right;
  font-size: 11px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 9px;
}

.metric {
  border: 1px solid rgba(56,189,248,.22);
  border-radius: 10px;
  background: rgba(3,17,31,.58);
  padding: 11px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-bottom: 7px;
}

.metric strong {
  font-size: 21px;
}

.danger strong,
.summary-card.danger strong {
  color: var(--pink);
}

.sem-card-status {
  min-width: 96px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 85, 115, .7);
  color: #fff;
  background: rgba(255, 85, 115, .22);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 950;
}

.sem-scale {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.sem-scale i {
  height: 8px;
  border-radius: 999px;
  background: #14395a;
}

.sem-scale i:nth-child(1) { background: rgba(34,197,94,.35); }
.sem-scale i:nth-child(2) { background: rgba(246,165,41,.35); }
.sem-scale i:nth-child(3) { background: rgba(249,115,22,.28); }
.sem-scale i:nth-child(4) { background: linear-gradient(90deg, rgba(255,85,115,.72), rgba(255,143,163,.96)); box-shadow: 0 0 20px rgba(255,85,115,.42); }

.sem-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}

.sem-metric {
  border: 1px solid rgba(56,189,248,.20);
  border-radius: 10px;
  background: rgba(3,17,31,.56);
  padding: 12px;
}

.sem-metric span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 9px;
}

.sem-metric strong {
  font-size: 22px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.summary-card {
  min-height: 112px;
  padding: 18px;
}

.summary-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 12px;
  font-size: 13px;
}

.summary-card strong {
  font-size: 30px;
  line-height: 1;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.28fr .9fr .8fr;
  gap: 14px;
  margin-bottom: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.chart-box {
  height: 310px;
  border: 1px solid rgba(56,189,248,.18);
  border-radius: 12px;
  background: rgba(3,17,31,.44);
  padding: 16px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  overflow: hidden;
}

.chart-bar {
  flex: 1;
  min-width: 4px;
  display: grid;
  align-items: end;
  gap: 2px;
  height: 100%;
}

.chart-bar b {
  display: block;
  border-radius: 5px 5px 0 0;
}

.chart-altas { background: var(--blue); }
.chart-bajas { background: var(--pink); }

.ranking-tabs {
  display: flex;
  gap: 6px;
}

.ranking-tabs button {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(56,189,248,.36);
  background: rgba(7,32,54,.74);
  color: #e8f7ff;
  font-weight: 950;
  cursor: pointer;
}

.ranking-tabs button.active {
  background: rgba(14,93,166,.72);
  border-color: rgba(56,169,255,.92);
}

.search {
  width: 100%;
  height: 42px;
  margin-bottom: 12px;
  border: 1px solid rgba(56,189,248,.22);
  border-radius: 10px;
  background: rgba(2,8,23,.78);
  color: #fff;
  padding: 0 14px;
  font: inherit;
}

.ranking-list,
.compact-list {
  display: grid;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
  padding-right: 6px;
}

.ranking-item,
.compact-item {
  border: 1px solid rgba(56,189,248,.20);
  background: rgba(7,32,54,.70);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
}

.ranking-item.active {
  border-color: rgba(56,169,255,.85);
  background: rgba(14,93,166,.42);
}

.ranking-item-top,
.compact-item-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.ranking-item strong,
.compact-item strong {
  color: #fff;
}

.ranking-item em,
.compact-item em {
  color: var(--blue);
  font-style: normal;
  font-size: 24px;
  font-weight: 950;
}

.ranking-item small,
.compact-item small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.ficha-box {
  border: 1px dashed rgba(141,177,206,.28);
  border-radius: 14px;
  padding: 16px;
  min-height: 280px;
}

.ficha-title {
  font-size: 24px;
  color: #fff;
  margin-bottom: 4px;
}

.ficha-sub {
  color: var(--muted);
  margin-bottom: 14px;
}

.ficha-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}

.hiper-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 18px;
}

.hiper-grid h4 {
  color: #fff;
  margin: 0 0 10px;
  font-size: 16px;
}

.loading,
.empty {
  color: var(--muted);
  font-weight: 850;
  padding: 16px;
}

.error {
  color: #ff8fa3;
  font-weight: 900;
  padding: 16px;
}

.criteria-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.62);
  padding: 28px;
}

.criteria-modal.open {
  display: flex;
}

.criteria-box {
  width: min(980px, 96vw);
  max-height: 86vh;
  overflow: auto;
  border: 1px solid rgba(56,189,248,.35);
  background: linear-gradient(180deg, #071d31, #020817);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 30px 90px rgba(0,0,0,.48);
}

.criteria-box h2 {
  margin: 0 0 16px;
  color: var(--blue);
}

.criteria-box h3 {
  margin: 18px 0 8px;
  color: #fff;
}

.criteria-box li {
  color: #b9d7ee;
  line-height: 1.55;
}

.criteria-box code {
  color: #fff;
  background: rgba(56,189,248,.12);
  border: 1px solid rgba(56,189,248,.22);
  border-radius: 6px;
  padding: 2px 6px;
}

.criteria-close {
  float: right;
  width: 42px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: rgba(7,32,54,.84);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

@media (max-width: 1500px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .timebar {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-left: 0;
  }

  .control-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

  .page {
    margin-left: 0;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .metric-grid,
  .hiper-grid {
    grid-template-columns: 1fr;
  }
}

/* MODULAR TIME FILTER INTEGRATION V1 */

.topbar {
  gap: 14px !important;
  align-items: center !important;
}

.topbar h1 {
  flex: 0 0 auto;
}

.topbar-filter {
  flex: 1 1 auto;
  min-width: 0;
}

.page-actions,
.pill.right,
a.pill {
  display: none !important;
}

.kpi-time-filter {
  margin-left: auto;
}

.kpi-time-filter button,
.kpi-time-filter input {
  line-height: 1 !important;
}

.ranking-list:empty::before {
  content: "Sin datos de instaladoras para este periodo o endpoint comercial no disponible.";
  display: block;
  color: #92b5d1;
  padding: 16px;
  border: 1px dashed rgba(141,177,206,.28);
  border-radius: 12px;
}

.chart-box:empty::before {
  content: "Sin evolución comercial para el periodo.";
  color: #92b5d1;
  padding: 16px;
}

@media (max-width: 1500px) {
  .topbar {
    align-items: flex-start !important;
  }

  .topbar-filter {
    width: 100%;
  }
}

/* GERENCIA TIME / SIDEBAR FIX V2 */

.sidebar-title {
  color: #f8fafc;
  font-size: 24px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.04em;
  text-align: center;
  margin: 4px 0 18px;
}

.sidebar-logo {
  margin-bottom: 30px !important;
}

.topbar {
  justify-content: flex-end !important;
}

.topbar h1 {
  display: none !important;
}

.topbar-filter {
  flex: 1 1 auto;
  width: 100%;
}


/* GERENCIA COMERCIAL REFINEMENT V1 */

.summary-grid {
  gap: 10px !important;
}

.summary-card {
  min-height: 94px !important;
  padding: 14px 16px !important;
}

.summary-card span {
  font-size: 12px !important;
  margin-bottom: 10px !important;
}

.summary-card strong {
  font-size: 27px !important;
}

.content-grid {
  grid-template-columns: 1.06fr .82fr .72fr !important;
  gap: 12px !important;
}

.evolution-panel,
.ranking-panel,
.ficha-panel {
  padding: 16px !important;
}

.chart-box {
  height: 260px !important;
  align-items: flex-end !important;
  justify-content: space-around !important;
  gap: 8px !important;
  padding: 22px 18px 34px !important;
  position: relative;
  border-color: rgba(56,189,248,.24) !important;
  background:
    linear-gradient(180deg, rgba(3,17,31,.22), rgba(3,17,31,.58)),
    repeating-linear-gradient(
      to top,
      rgba(141,177,206,.10) 0,
      rgba(141,177,206,.10) 1px,
      transparent 1px,
      transparent 48px
    ) !important;
}

.chart-bar {
  flex: 0 1 42px !important;
  min-width: 32px !important;
  max-width: 52px !important;
  height: 100% !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  align-items: end !important;
  gap: 4px !important;
  position: relative !important;
  padding-bottom: 20px !important;
}

.chart-bar::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) rotate(-24deg);
  transform-origin: center;
  color: #8db1ce;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.chart-bar b {
  min-height: 2px;
  border-radius: 6px 6px 0 0 !important;
  box-shadow: 0 0 14px rgba(56,189,248,.18);
}

.chart-altas {
  background: linear-gradient(180deg, #38bdf8, #0ea5e9) !important;
}

.chart-bajas {
  background: linear-gradient(180deg, #ff5573, #e11d48) !important;
}

.ranking-item {
  padding: 10px 12px !important;
}

.ranking-item em {
  font-size: 21px !important;
}

.ficha-title {
  font-size: 21px !important;
}

.metric strong {
  font-size: 19px !important;
}

/* GERENCIA HIPERACTIVIDAD V1 */

.hiper-panel {
  padding: 16px !important;
}

.hiper-grid {
  grid-template-columns: 1fr 1fr !important;
  gap: 18px !important;
}

.hiper-grid h4 {
  color: #ffffff;
  font-size: 15px !important;
  margin: 0 0 10px !important;
}

.compact-list {
  max-height: 360px !important;
  overflow: auto;
  padding-right: 8px;
  display: grid;
  gap: 9px;
}

.hiper-bar-item {
  border: 1px solid rgba(56,189,248,.22);
  background: rgba(7,32,54,.62);
  border-radius: 12px;
  padding: 11px 12px;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.hiper-bar-item:hover,
.hiper-bar-item.active {
  border-color: rgba(56,169,255,.88);
  background: rgba(14,93,166,.36);
  transform: translateY(-1px);
}

.hiper-bar-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 9px;
}

.hiper-bar-top strong {
  color: #ffffff;
  display: block;
  font-size: 14px;
  line-height: 1.18;
}

.hiper-bar-top small {
  display: block;
  margin-top: 4px;
  color: #8db1ce;
  font-size: 11px;
  font-weight: 900;
}

.hiper-bar-top em {
  color: #38bdf8;
  font-style: normal;
  font-size: 23px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}

.hiper-track {
  height: 8px;
  border-radius: 999px;
  background: #14395a;
  overflow: hidden;
}

.hiper-fill {
  height: 100%;
  min-width: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #39e6d3 0%, #ffc857 54%, #ff5573 100%);
  box-shadow: 0 0 14px rgba(56,189,248,.18);
}

@media (max-width: 1100px) {
  .hiper-grid {
    grid-template-columns: 1fr !important;
  }
}

/* HIPERACTIVIDAD RATIO POR ABONADO V1 */

.hiper-bar-foot {
  margin-top: 5px;
  color: #8db1ce;
  font-size: 10px;
  font-weight: 900;
  text-align: right;
}

.hiper-bar-top em {
  min-width: 86px;
  text-align: right;
}

.hiper-bar-item.active .hiper-bar-foot,
.hiper-bar-item:hover .hiper-bar-foot {
  color: #bde7ff;
}

/* KPI_GERENCIA_SEMAFORO_STATE_V2_START */

.semaforo-card {
  --sem-state-color: #64748b;
  --sem-state-background: rgba(100, 116, 139, 0.18);
  --sem-state-border: rgba(148, 163, 184, 0.50);
}

.semaforo-card[data-state="verde"] {
  --sem-state-color: #25d37f;
  --sem-state-background: rgba(19, 119, 75, 0.28);
  --sem-state-border: rgba(37, 211, 127, 0.85);
  border-color: rgba(37, 211, 127, 0.55);
}

.semaforo-card[data-state="ambar"] {
  --sem-state-color: #f2b134;
  --sem-state-background: rgba(142, 91, 13, 0.30);
  --sem-state-border: rgba(242, 177, 52, 0.88);
  border-color: rgba(242, 177, 52, 0.58);
}

.semaforo-card[data-state="naranja"] {
  --sem-state-color: #f47b35;
  --sem-state-background: rgba(145, 65, 18, 0.30);
  --sem-state-border: rgba(244, 123, 53, 0.88);
  border-color: rgba(244, 123, 53, 0.58);
}

.semaforo-card[data-state="rojo"] {
  --sem-state-color: #f05b83;
  --sem-state-background: rgba(139, 31, 65, 0.30);
  --sem-state-border: rgba(240, 91, 131, 0.90);
  border-color: rgba(240, 91, 131, 0.60);
}

.semaforo-card[data-state="sin-datos"] {
  --sem-state-color: #94a3b8;
  --sem-state-background: rgba(71, 85, 105, 0.25);
  --sem-state-border: rgba(148, 163, 184, 0.65);
}

.semaforo-card .sem-card-status {
  color: var(--sem-state-color);
  background: var(--sem-state-background);
  border-color: var(--sem-state-border);
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.15);
}

.semaforo-card .sem-scale i {
  opacity: 0.28;
  transform: scaleY(0.82);
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.semaforo-card .sem-scale i:nth-child(1) {
  background: #25d37f !important;
}

.semaforo-card .sem-scale i:nth-child(2) {
  background: #f2b134 !important;
}

.semaforo-card .sem-scale i:nth-child(3) {
  background: #f47b35 !important;
}

.semaforo-card .sem-scale i:nth-child(4) {
  background: #f05b83 !important;
}

.semaforo-card[data-state="verde"] .sem-scale i:nth-child(1),
.semaforo-card[data-state="ambar"] .sem-scale i:nth-child(2),
.semaforo-card[data-state="naranja"] .sem-scale i:nth-child(3),
.semaforo-card[data-state="rojo"] .sem-scale i:nth-child(4) {
  opacity: 1;
  transform: scaleY(1);
  box-shadow: 0 0 12px var(--sem-state-color);
}

/* KPI_GERENCIA_SEMAFORO_STATE_V2_END */

/* KPI_HIPER_ABONADOS_LEADERBOARD_V1_START */

#hiper-abonados {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hiper-abonado-item {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;

  min-height: 72px;
  padding: 10px 12px 10px 10px;

  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 13px;

  background:
    linear-gradient(
      100deg,
      rgba(11, 44, 69, 0.88),
      rgba(5, 29, 49, 0.90)
    );

  overflow: hidden;

  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.hiper-abonado-item::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: rgba(56, 189, 248, 0.52);
}

.hiper-abonado-item:hover {
  transform: translateX(3px);
  border-color: rgba(56, 189, 248, 0.58);

  background:
    linear-gradient(
      100deg,
      rgba(13, 53, 83, 0.95),
      rgba(5, 32, 54, 0.96)
    );

  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.17),
    inset 0 0 20px rgba(56, 189, 248, 0.025);
}

.hiper-abonado-rank {
  display: grid;
  place-items: center;

  width: 40px;
  height: 40px;

  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 11px;

  color: #81d9ff;
  background: rgba(14, 165, 233, 0.09);

  font-size: 15px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.hiper-abonado-content {
  min-width: 0;
}

.hiper-abonado-name {
  display: block;
  overflow: hidden;

  color: #f8fafc;

  font-size: 14px;
  line-height: 1.2;
  font-weight: 950;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.hiper-abonado-meta {
  display: flex;
  align-items: center;
  gap: 6px;

  min-width: 0;
  margin-top: 7px;

  color: #8db1ce;

  font-size: 11px;
  line-height: 1;
  font-weight: 850;
}

.hiper-abonado-installer {
  max-width: 250px;
  overflow: hidden;

  color: #9fc7e5;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.hiper-abonado-province {
  flex: 0 0 auto;
  padding-left: 7px;
  border-left: 1px solid rgba(141, 177, 206, 0.28);
  color: #718fab;
}

.hiper-abonado-values {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.hiper-abonado-total {
  min-width: 66px;
  text-align: right;
}

.hiper-abonado-total strong {
  display: block;

  color: #38bdf8;

  font-size: 24px;
  line-height: 0.95;
  font-weight: 950;
  letter-spacing: -0.035em;
}

.hiper-abonado-total span {
  display: block;
  margin-top: 5px;

  color: #6f91ad;

  font-size: 9px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hiper-abonado-rate {
  min-width: 52px;
  padding: 7px 8px;

  border: 1px solid rgba(129, 217, 255, 0.22);
  border-radius: 999px;

  color: #bceaff;
  background: rgba(56, 189, 248, 0.08);

  font-size: 11px;
  line-height: 1;
  font-weight: 950;
  text-align: center;
  white-space: nowrap;
}

/* Primeras posiciones: jerarquía, no estado de alarma */

.hiper-abonado-item.is-first {
  border-color: rgba(56, 189, 248, 0.52);

  background:
    linear-gradient(
      100deg,
      rgba(11, 58, 91, 0.96),
      rgba(5, 31, 52, 0.94)
    );
}

.hiper-abonado-item.is-first::before {
  background: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.65);
}

.hiper-abonado-item.is-first .hiper-abonado-rank {
  color: #031525;
  border-color: rgba(125, 211, 252, 0.86);
  background: linear-gradient(145deg, #7dd3fc, #38bdf8);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.22);
}

.hiper-abonado-item.is-second::before {
  background: rgba(125, 211, 252, 0.82);
}

.hiper-abonado-item.is-third::before {
  background: rgba(14, 165, 233, 0.72);
}

@media (max-width: 1150px) {
  .hiper-abonado-item {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .hiper-abonado-rank {
    width: 36px;
    height: 36px;
  }

  .hiper-abonado-rate {
    display: none;
  }
}

@media (max-width: 700px) {
  .hiper-abonado-item {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .hiper-abonado-values {
    grid-column: 2;
    justify-content: flex-start;
    margin-top: 2px;
  }

  .hiper-abonado-total {
    display: flex;
    align-items: baseline;
    gap: 6px;
    text-align: left;
  }

  .hiper-abonado-total strong {
    font-size: 19px;
  }

  .hiper-abonado-total span {
    margin-top: 0;
  }
}

/* KPI_HIPER_ABONADOS_LEADERBOARD_V1_END */

/* KPI_GERENCIA_COMERCIAL_VISUAL_V2_START */

/* Contención real del grid */

.content-grid {
  grid-template-columns:
    minmax(0, 1.08fr)
    minmax(0, 0.88fr)
    minmax(0, 0.76fr)
    !important;

  align-items: stretch;
  gap: 12px !important;
  min-width: 0;
}

.content-grid > .panel,
.evolution-panel,
.ranking-panel,
.ficha-panel {
  min-width: 0 !important;
  max-width: 100%;
  overflow: hidden;
}

.evolution-panel,
.ranking-panel,
.ficha-panel {
  min-height: 420px;
}

/* ==========================================================
   EVOLUCIÓN
   ========================================================== */

.evolution-panel {
  display: flex;
  flex-direction: column;
}

.evolution-panel .section-head {
  margin-bottom: 10px;
}

#evolucion-chart.chart-box {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch !important;
  justify-content: stretch !important;

  width: 100%;
  min-width: 0;
  height: 330px !important;

  gap: 10px !important;
  padding: 12px !important;

  overflow: hidden !important;

  background:
    linear-gradient(
      180deg,
      rgba(3, 17, 31, 0.22),
      rgba(3, 17, 31, 0.66)
    ),
    repeating-linear-gradient(
      to top,
      rgba(141, 177, 206, 0.08) 0,
      rgba(141, 177, 206, 0.08) 1px,
      transparent 1px,
      transparent 44px
    ) !important;
}

.commercial-chart-summary {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr))
    auto;
  gap: 7px;
  align-items: stretch;
}

.commercial-summary-item {
  min-width: 0;
  padding: 8px 10px;

  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 9px;

  background: rgba(3, 24, 42, 0.78);
}

.commercial-summary-item span {
  display: block;
  overflow: hidden;

  color: #7598b4;

  font-size: 9px;
  line-height: 1;
  font-weight: 900;

  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.commercial-summary-item strong {
  display: block;
  margin-top: 6px;

  color: #f8fafc;

  font-size: 18px;
  line-height: 1;
  font-weight: 950;
}

.commercial-summary-item.altas strong {
  color: #38bdf8;
}

.commercial-summary-item.bajas strong {
  color: #ff5573;
}

.commercial-summary-item.saldo.positive strong {
  color: #35d48a;
}

.commercial-summary-item.saldo.negative strong {
  color: #ff6b81;
}

.commercial-chart-period {
  display: flex;
  align-items: center;
  justify-content: center;

  min-width: 68px;
  padding: 0 9px;

  border: 1px solid rgba(141, 177, 206, 0.20);
  border-radius: 9px;

  color: #8db1ce;
  background: rgba(3, 24, 42, 0.62);

  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.commercial-chart-viewport {
  min-width: 0;
  max-width: 100%;
  height: 100%;

  overflow-x: auto;
  overflow-y: hidden;

  scrollbar-width: thin;
  scrollbar-color:
    rgba(56, 189, 248, 0.45)
    rgba(3, 17, 31, 0.55);
}

.commercial-chart-viewport::-webkit-scrollbar {
  height: 7px;
}

.commercial-chart-viewport::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(3, 17, 31, 0.55);
}

.commercial-chart-viewport::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.44);
}

.commercial-chart-series {
  display: grid;
  grid-template-columns:
    repeat(
      var(--chart-items),
      minmax(24px, 1fr)
    );

  align-items: stretch;
  gap: 6px;

  width: 100%;
  min-width: calc(var(--chart-items) * 31px);
  height: 100%;

  padding: 5px 3px 4px;
}

.commercial-chart-group {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 20px;
  align-items: stretch;
  gap: 4px;

  min-width: 0;
  height: 100%;
}

.commercial-chart-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 3px;

  min-height: 0;
  height: 100%;
}

.commercial-chart-columns i {
  display: block;

  min-height: 2px;
  border-radius: 6px 6px 2px 2px;

  transition:
    filter 150ms ease,
    transform 150ms ease;
}

.commercial-chart-group:hover
.commercial-chart-columns i {
  filter: brightness(1.22);
  transform: scaleX(1.08);
}

.commercial-bar-altas {
  background:
    linear-gradient(
      180deg,
      #48c7fa,
      #0ea5e9
    );

  box-shadow:
    0 0 12px rgba(56, 189, 248, 0.20);
}

.commercial-bar-bajas {
  background:
    linear-gradient(
      180deg,
      #ff6480,
      #e11d48
    );

  box-shadow:
    0 0 12px rgba(255, 85, 115, 0.17);
}

.commercial-chart-group > span {
  display: block;

  color: #7396b2;

  font-size: 8px;
  line-height: 18px;
  font-weight: 900;

  text-align: center;
  white-space: nowrap;

  transform: rotate(-22deg);
  transform-origin: center;
}

.commercial-chart-group > span.is-hidden-label {
  visibility: hidden;
}

/* ==========================================================
   RANKING
   ========================================================== */

.ranking-panel .section-head {
  align-items: center;
  margin-bottom: 10px;
}

.ranking-tabs {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ranking-tabs button {
  height: 31px;
  padding: 0 12px;

  font-size: 12px;
}

.ranking-panel .search {
  height: 38px;
  margin-bottom: 9px;
}

.ranking-list {
  display: flex !important;
  flex-direction: column;

  max-height: 326px !important;
  gap: 7px !important;
}

.ranking-item {
  display: grid;
  grid-template-columns:
    28px
    minmax(0, 1fr)
    auto;

  align-items: center;
  gap: 10px;

  min-width: 0;
  min-height: 72px;

  padding: 9px 10px !important;

  border-color: rgba(56, 189, 248, 0.18);
  background:
    linear-gradient(
      100deg,
      rgba(7, 32, 54, 0.78),
      rgba(4, 23, 40, 0.82)
    );

  transition:
    border-color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}

.ranking-item:hover {
  transform: translateX(2px);
  border-color: rgba(56, 189, 248, 0.48);
}

.ranking-item.active {
  border-color: rgba(56, 169, 255, 0.88);

  background:
    linear-gradient(
      100deg,
      rgba(14, 93, 166, 0.40),
      rgba(7, 42, 70, 0.90)
    );

  box-shadow:
    inset 3px 0 0 #38bdf8;
}

.ranking-position {
  display: grid;
  place-items: center;

  width: 28px;
  height: 28px;

  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;

  color: #75cdef;
  background: rgba(56, 189, 248, 0.07);

  font-size: 10px;
  line-height: 1;
  font-weight: 950;
}

.ranking-item.active .ranking-position {
  color: #04131f;
  border-color: #69d2fb;
  background: #38bdf8;
}

.ranking-main {
  min-width: 0;
}

.ranking-name-line {
  display: flex;
  align-items: center;
  gap: 7px;

  min-width: 0;
}

.ranking-name-line strong {
  min-width: 0;
  overflow: hidden;

  color: #f8fafc;

  font-size: 13px;
  line-height: 1.15;
  font-weight: 950;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-province {
  flex: 0 0 auto;
  max-width: 105px;
  overflow: hidden;

  padding: 3px 6px;

  border: 1px solid rgba(141, 177, 206, 0.18);
  border-radius: 999px;

  color: #7f9fba;
  background: rgba(141, 177, 206, 0.05);

  font-size: 8px;
  line-height: 1;
  font-weight: 900;

  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.ranking-kpis {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;

  margin-top: 8px;
}

.ranking-kpi {
  display: inline-flex;
  align-items: center;
  gap: 4px;

  padding: 3px 6px;

  border: 1px solid rgba(141, 177, 206, 0.14);
  border-radius: 6px;

  color: #789ab5;
  background: rgba(3, 17, 31, 0.35);

  font-size: 8px;
  line-height: 1;
  font-weight: 850;
  white-space: nowrap;
}

.ranking-kpi b {
  color: #d9eefb;
  font-size: 9px;
}

.ranking-kpi.altas b {
  color: #53cbfa;
}

.ranking-kpi.bajas b {
  color: #ff718a;
}

.ranking-kpi.saldo.positive b {
  color: #35d48a;
}

.ranking-kpi.saldo.negative b {
  color: #ff718a;
}

.ranking-primary {
  min-width: 70px;
  text-align: right;
}

.ranking-primary em {
  display: block;

  color: #38bdf8;

  font-size: 21px !important;
  line-height: 0.95;
  font-style: normal;
  font-weight: 950;

  letter-spacing: -0.035em;
  white-space: nowrap;
}

.ranking-primary span {
  display: block;
  margin-top: 6px;

  color: #6f91ad;

  font-size: 8px;
  line-height: 1;
  font-weight: 900;

  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ==========================================================
   FICHA
   ========================================================== */

.ficha-panel {
  display: flex;
  flex-direction: column;
}

.ficha-box {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;

  min-width: 0;
  min-height: 320px;
  padding: 13px;

  border-style: solid;
  border-color: rgba(56, 189, 248, 0.20);

  background:
    linear-gradient(
      160deg,
      rgba(6, 33, 55, 0.72),
      rgba(3, 20, 35, 0.85)
    );
}

.ficha-header {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    auto;

  align-items: start;
  gap: 12px;

  padding-bottom: 13px;
  border-bottom:
    1px solid rgba(141, 177, 206, 0.14);
}

.ficha-identity {
  min-width: 0;
}

.ficha-title {
  overflow: hidden;

  margin: 0 !important;

  color: #f8fafc;

  font-size: 20px !important;
  line-height: 1.12;
  font-weight: 950;

  text-overflow: ellipsis;
}

.ficha-location {
  display: inline-flex;

  margin-top: 8px;
  padding: 4px 7px;

  border: 1px solid rgba(56, 189, 248, 0.20);
  border-radius: 999px;

  color: #8db1ce;
  background: rgba(56, 189, 248, 0.06);

  font-size: 9px;
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
}

.ficha-primary {
  min-width: 85px;
  padding: 9px 10px;

  border: 1px solid rgba(56, 189, 248, 0.30);
  border-radius: 10px;

  background:
    linear-gradient(
      145deg,
      rgba(14, 93, 166, 0.25),
      rgba(7, 40, 67, 0.42)
    );

  text-align: right;
}

.ficha-primary span {
  display: block;

  color: #82a8c4;

  font-size: 8px;
  line-height: 1;
  font-weight: 900;

  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.ficha-primary strong {
  display: block;
  margin-top: 7px;

  color: #38bdf8;

  font-size: 22px;
  line-height: 1;
  font-weight: 950;

  white-space: nowrap;
}

.ficha-commercial-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 8px;
  margin-top: 12px;
}

.ficha-stat {
  min-width: 0;
  padding: 10px;

  border: 1px solid rgba(56, 189, 248, 0.15);
  border-radius: 9px;

  background: rgba(3, 17, 31, 0.46);
}

.ficha-stat span {
  display: block;

  color: #789ab5;

  font-size: 9px;
  line-height: 1;
  font-weight: 900;
}

.ficha-stat strong {
  display: block;
  margin-top: 8px;

  color: #f8fafc;

  font-size: 18px;
  line-height: 1;
  font-weight: 950;
}

.ficha-stat.altas strong {
  color: #38bdf8;
}

.ficha-stat.bajas strong {
  color: #ff5573;
}

.ficha-stat.saldo.positive strong {
  color: #35d48a;
}

.ficha-stat.saldo.negative strong {
  color: #ff5573;
}

.ficha-operational {
  margin-top: 12px;
  padding: 10px;

  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 10px;

  background:
    linear-gradient(
      135deg,
      rgba(7, 44, 70, 0.48),
      rgba(3, 23, 40, 0.60)
    );
}

.ficha-operational-title {
  margin-bottom: 9px;

  color: #7aa1bd;

  font-size: 8px;
  line-height: 1;
  font-weight: 950;

  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.ficha-operational-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 8px;
}

.ficha-operational-grid > div {
  min-width: 0;
}

.ficha-operational-grid span {
  display: block;

  color: #789ab5;

  font-size: 9px;
  line-height: 1;
  font-weight: 850;
}

.ficha-operational-grid strong {
  display: block;
  margin-top: 7px;

  overflow: hidden;

  color: #dff4ff;

  font-size: 17px;
  line-height: 1;
  font-weight: 950;

  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================
   RESPONSIVE CONTROLADO
   ========================================================== */

@media (max-width: 1450px) {
  .content-grid {
    grid-template-columns:
      minmax(0, 1fr)
      minmax(0, 0.95fr)
      !important;
  }

  .ficha-panel {
    grid-column: 1 / -1;
    min-height: auto;
  }

  .ficha-box {
    min-height: 250px;
  }

  .ficha-commercial-grid {
    grid-template-columns:
      repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .content-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .ficha-panel {
    grid-column: auto;
  }

  .commercial-chart-summary {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

  .commercial-chart-period {
    display: none;
  }

  .ficha-commercial-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .commercial-chart-summary {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .commercial-summary-item.saldo {
    grid-column: 1 / -1;
  }

  .ranking-kpi.activos,
  .ranking-kpi.saldo {
    display: none;
  }

  .ranking-province {
    display: none;
  }
}

/* KPI_GERENCIA_COMERCIAL_VISUAL_V2_END */

/* KPI_GERENCIA_RANKING_WIDTH_BALANCE_V1_START */

/*
  Reparto de la franja comercial:
  - Evolución: mantiene presencia principal.
  - Ranking: gana espacio para mejorar lectura.
  - Ficha: queda más compacta.
*/

.content-grid {
  grid-template-columns:
    minmax(0, 1.08fr)
    minmax(0, 1.02fr)
    minmax(0, 0.60fr)
    !important;
}

/* Ranking ligeramente más legible */

.ranking-name-line strong {
  font-size: 14px !important;
}

.ranking-kpis {
  gap: 5px !important;
}

.ranking-kpi {
  padding: 4px 7px !important;
  font-size: 8.5px !important;
}

.ranking-kpi b {
  font-size: 9.5px !important;
}

.ranking-primary {
  min-width: 78px !important;
}

.ranking-primary em {
  font-size: 23px !important;
}

/* Ficha más compacta para aprovechar mejor su nueva anchura */

.ficha-box {
  padding: 11px !important;
}

.ficha-header {
  gap: 8px !important;
}

.ficha-title {
  font-size: 18px !important;
}

.ficha-primary {
  min-width: 76px !important;
  padding: 8px !important;
}

.ficha-primary strong {
  font-size: 20px !important;
}

.ficha-commercial-grid {
  gap: 7px !important;
}

.ficha-stat {
  padding: 9px !important;
}

.ficha-stat strong {
  font-size: 17px !important;
}

.ficha-operational {
  padding: 9px !important;
}

/*
  En resoluciones intermedias se mantienen Ranking y Evolución
  en dos columnas y la ficha pasa debajo, como hasta ahora.
*/

@media (max-width: 1450px) {
  .content-grid {
    grid-template-columns:
      minmax(0, 1fr)
      minmax(0, 1.08fr)
      !important;
  }
}

/* KPI_GERENCIA_RANKING_WIDTH_BALANCE_V1_END */

/* GERENCIA_HIPERACTIVIDAD_ESTABLE_20260810_CSS */
.hiper-panel .hiper-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.85rem 0;
}

.hiper-panel .hiper-title-row h3 {
  margin: 0;
}

.hiper-panel .hiper-scenario-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem;
  border: 1px solid rgba(47, 179, 255, 0.35);
  border-radius: 999px;
  background: rgba(2, 19, 33, 0.78);
  flex: 0 0 auto;
}

.hiper-panel .hiper-scenario-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  background: transparent;
  color: rgba(220, 242, 255, 0.75);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.hiper-panel .hiper-scenario-btn.active {
  background: linear-gradient(135deg, #42c4ff, #84f5cf);
  color: #061827;
}

.hiper-panel .hiper-scenario-btn:hover {
  color: #ffffff;
}

.hiper-panel .hiper-bar-foot {
  text-align: right;
}

@media (max-width: 900px) {
  .hiper-panel .hiper-title-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* GERENCIA_HIPERACTIVIDAD_TOGGLE_SUAVE_20260810 */
.hiper-panel.hiper-soft-loading .hiper-bar-item {
  opacity: 0.72;
  transition: opacity 0.16s ease;
}

.hiper-panel.hiper-soft-loading .hiper-scenario-toolbar {
  pointer-events: none;
  opacity: 0.82;
}

/* GERENCIA_HIPERACTIVIDAD_AUDITABLE_LEGEND_20260810 */
.audit-kpi-box {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(50, 190, 255, 0.28);
  border-radius: 14px;
  background: rgba(3, 24, 43, 0.44);
}

.audit-kpi-box h4 {
  margin: 0 0 8px 0;
  font-size: 15px;
  color: #31c8ff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.audit-kpi-box h5 {
  margin: 16px 0 8px 0;
  font-size: 13px;
  color: #d9f4ff;
  letter-spacing: 0.02em;
}

.audit-kpi-box p {
  margin: 6px 0 10px 0;
  line-height: 1.45;
  color: rgba(232, 246, 255, 0.92);
}

.audit-kpi-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 14px 0;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.audit-kpi-table th,
.audit-kpi-table td {
  border: 1px solid rgba(120, 210, 255, 0.18);
  padding: 7px 8px;
  vertical-align: top;
}

.audit-kpi-table th {
  background: rgba(49, 200, 255, 0.12);
  color: #bfeeff;
  font-weight: 800;
  text-align: left;
}

.audit-kpi-table td {
  color: rgba(235, 248, 255, 0.92);
}

.audit-kpi-table code,
.audit-kpi-box code {
  color: #7ee7ff;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 10.5px;
}


/* KPI_GERENCIA_FICHA_LOGO_V7_20260813_START */

/* Mantener distribución que ya se ve correcta: tendencia más ancha, ranking y ficha equilibrados. */
@media (min-width: 1180px) {
  .content-grid {
    grid-template-columns:
      minmax(420px, 1.20fr)
      minmax(360px, 1fr)
      minmax(360px, 1fr) !important;
  }
}

/* Cabecera de ficha rediseñada: datos a la izquierda, logo a la derecha, carga operativa abajo. */
.ficha-layout-v7 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 12px;
}

.ficha-main-v7 {
  min-width: 0;
}

.ficha-header-v7 {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(115, 203, 255, .13);
}

.ficha-header-v7 .ficha-title {
  margin: 0;
  line-height: 1.16;
}

.ficha-header-v7 .ficha-location {
  margin-top: 6px;
}

.ficha-header-v7 .ficha-primary {
  flex: 0 0 auto;
}

.ficha-commercial-grid-v7 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  clear: none !important;
}

.ficha-commercial-grid-v7 .ficha-stat {
  min-height: 52px;
  padding: 10px 12px;
}

.ficha-logo-column-v7 {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  min-width: 0;
}

.ficha-logo-card-v7 {
  position: relative;
  width: 100%;
  min-height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 18px;
  padding: 12px;
  border: 1px solid rgba(75, 202, 255, .24);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 10px 24px rgba(0,0,0,.20);
}

.ficha-logo-card-v7.dark-logo {
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.30), transparent 34%),
    linear-gradient(135deg, rgba(230,243,253,.82), rgba(127,188,224,.46));
}

.ficha-logo-card-v7.light-logo {
  background:
    radial-gradient(circle at 20% 20%, rgba(54,201,255,.18), transparent 36%),
    linear-gradient(135deg, rgba(3,13,26,.98), rgba(10,52,84,.86));
}

.ficha-logo-card-v7.mixed-logo,
.ficha-logo-card-v7.fallback {
  background:
    radial-gradient(circle at 20% 20%, rgba(54,201,255,.16), transparent 36%),
    linear-gradient(135deg, rgba(12,42,67,.92), rgba(4,17,31,.96));
}

.ficha-logo-card-v7 img {
  position: relative;
  z-index: 2;
  display: block;
  max-width: 108px;
  max-height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.24));
}

.ficha-logo-card-v7 span {
  position: relative;
  z-index: 1;
  min-width: 52px;
  height: 52px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  color: #dff6ff;
  background: linear-gradient(135deg, rgba(54,201,255,.26), rgba(24,91,132,.34));
  border: 1px solid rgba(106,216,255,.30);
  font-weight: 950;
  letter-spacing: .08em;
  font-size: 17px;
}

.ficha-operational-v7 {
  margin-top: 12px;
}

/* No mostrar etiquetas internas de tema/logo. */
.ficha-logo-meta {
  display: none !important;
}

@media (max-width: 760px) {
  .ficha-layout-v7 {
    grid-template-columns: 1fr;
  }

  .ficha-logo-card-v7 {
    min-height: 92px;
  }
}

/* KPI_GERENCIA_FICHA_LOGO_V7_20260813_END */



/* ==========================================================================
   G4H5B_GERENCIA_SIDEBAR_COMPOSITOR_V1_20260819

   Auditoría G4H5A:
   - hover sidebar genera 0 API.
   - geometría final ya permanece en 34px.
   - residual perceptivo compatible con repaint:
       box-shadow animado + fade de hijos.

   Contrato:
   - transform es la única animación.
   - sin box-shadow animado.
   - sin opacity animation de hijos.
   - paint contenido dentro de la propia sidebar.
   ========================================================================== */

@media (min-width: 901px) {

  /*
   * Especificidad deliberadamente superior a las capas
   * compartidas para que esta página tenga un contrato
   * de composición completamente estable.
   */

  html body.gerencia-native-sidebar
  aside.sidebar.kpi-sidebar-unified {

    transform:
      translate3d(
        calc(
          var(--kpi-side-closed)
          - var(--kpi-side-open)
        ),
        0,
        0
      ) !important;

    transition:
      transform 145ms cubic-bezier(.2,.8,.2,1)
      !important;

    box-shadow:
      none !important;

    will-change:
      transform !important;

    backface-visibility:
      hidden !important;

    contain:
      paint !important;

    isolation:
      isolate !important;
  }


  html body.gerencia-native-sidebar
  aside.sidebar.kpi-sidebar-unified:hover,

  html body.gerencia-native-sidebar
  aside.sidebar.kpi-sidebar-unified:focus-within {

    transform:
      translate3d(
        0,
        0,
        0
      ) !important;

    box-shadow:
      none !important;
  }


  /*
   * La página principal nunca participa en la animación.
   */

  html body.gerencia-native-sidebar
  > main.page,

  html body.gerencia-native-sidebar:has(
    aside.sidebar:hover
  )
  > main.page,

  html body.gerencia-native-sidebar:has(
    aside.sidebar:focus-within
  )
  > main.page {

    margin-left:
      var(--kpi-side-closed) !important;

    width:
      calc(
        100vw
        - var(--kpi-side-closed)
      ) !important;

    max-width:
      none !important;

    min-width:
      0 !important;

    transform:
      none !important;

    transition:
      none !important;
  }


  /*
   * Evitar que cada bloque del menú cree su propia
   * transición de opacidad durante el desplazamiento.
   *
   * El estado cerrado/abierto sigue usando las reglas
   * opacity:0/1 existentes; sólo desaparece la animación.
   */

  html body.gerencia-native-sidebar
  aside.sidebar.kpi-sidebar-unified
  > * {

    transition:
      none !important;
  }
}

