.brand-logo {
  display: block;
  object-fit: contain;
}

.login-logo {
  width: 260px;
  height: 260px;
  object-position: center;
  margin: -78px 0 -72px -20px;
}

.sidebar-logo {
  width: 88px;
  height: 88px;
  object-position: center;
  margin: -20px -18px -20px -18px;
}

.test-check {
  padding: 10px 12px;
  border: 1px solid #f0d38a;
  border-radius: 10px;
  background: #fff8e7;
}

.finance-select {
  min-width: 112px;
  min-height: 34px;
  padding: 5px 8px;
  font-size: 11px;
}

.status-test,
.status-courtesy {
  background: #fff2d7;
  color: #8b5d00;
}

.status-sale {
  background: #e4f8ed;
  color: #087c48;
}

.status-pending {
  background: #e9f1ff;
  color: #255daa;
}

.status-void,
.status-refunded {
  background: #fde7ea;
  color: #a42838;
}

.router-select {
  width: auto;
  min-width: 150px;
  max-width: 220px;
  min-height: 40px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 780;
  border-color: #cbd5e1;
  background: #f8fafc;
}

.router-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.router-status-pill i,
.router-live-bar i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.router-live-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.35;
  border: 1px solid transparent;
  margin-top: -2px;
}

.router-live-bar .status-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.router-live-bar .reprobe-btn {
  background: transparent;
  border: none;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  color: inherit;
  flex-shrink: 0;
}

.router-status-pill.checking,
.router-live-bar.checking {
  background: #fff8e6;
  border-color: #f5d487;
  color: #8a5a00;
}

.router-status-pill.checking i,
.router-live-bar.checking i {
  background: #f59e0b;
  animation: auraPulse 1s infinite ease-in-out;
}

.router-status-pill.online,
.router-live-bar.online {
  background: #e6f9ef;
  border-color: #9de0bd;
  color: #066a3b;
}

.router-status-pill.online i,
.router-live-bar.online i {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.router-status-pill.offline,
.router-live-bar.offline {
  background: #fde8eb;
  border-color: #f5b3bd;
  color: #9e1c2e;
}

.router-status-pill.offline i,
.router-live-bar.offline i {
  background: #ef4444;
}

@keyframes auraPulse {
  0%, 100% { transform: scale(0.85); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
}

@media (max-width: 480px) {
  .router-select {
    min-width: 120px;
    max-width: 165px;
    padding: 5px 8px;
    font-size: 12px;
  }
  .router-status-pill {
    padding: 4px 9px;
    font-size: 11px;
  }
}

.accounting-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.accounting-filter-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.period-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-chip {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  background: #f1f5f9;
}

.preset-chip.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.accounting-filter-dates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.day-filter-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: #0284c7;
  text-decoration: underline;
  cursor: pointer;
}

/* Biblioteca y Constructor Visual de Plantillas Hotspot */
.tpl-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.tpl-lib-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  color: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.22);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.tpl-lib-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 17, 31, 0.15) 0%, rgba(7, 17, 31, 0.88) 100%);
  z-index: 0;
}

.tpl-lib-card > * {
  position: relative;
  z-index: 1;
}

.tpl-lib-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f59e0b;
  color: #1e293b;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tpl-lib-icon {
  margin: auto auto 14px;
  width: 68px;
  height: 78px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  color: #0f3d91;
  display: grid;
  place-items: center;
  font-size: 34px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.tpl-lib-card h4 {
  margin: 0 0 2px;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

.tpl-lib-card p {
  margin: 0 0 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
}

.tpl-lib-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tpl-lib-actions button {
  background: rgba(7, 17, 31, 0.86);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tpl-lib-actions button:hover {
  background: #0f172a;
  border-color: #38bdf8;
}

.tpl-builder-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 960px) {
  .tpl-builder-layout {
    grid-template-columns: 1fr;
  }
  .tpl-builder-layout.mode-preview .tpl-editor-pane {
    display: none;
  }
  .tpl-builder-layout.mode-design .tpl-preview-pane {
    display: none;
  }
}

.tpl-bg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tpl-tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #334155;
}

.tpl-tool-chip input[type="color"] {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.tpl-add-modal {
  background: #0b172a;
  color: #f8fafc;
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.tpl-add-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.tpl-add-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.tpl-add-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  background: #13233f;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  cursor: pointer;
  font-size: 13px;
}

.tpl-add-list button:hover {
  background: #1e355e;
  border-color: #38bdf8;
}

.tpl-add-list button span {
  font-size: 16px;
  width: 24px;
  text-align: center;
}

.tpl-add-list button strong {
  flex: 1;
}

.tpl-add-list button i {
  font-style: normal;
  font-size: 18px;
  font-weight: 800;
  color: #38bdf8;
}

.tpl-block-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tpl-block-card {
  background: #0f1e36;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
}

.tpl-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.tpl-block-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
}

.tpl-block-actions {
  display: flex;
  gap: 4px;
}

.tpl-block-actions button {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

.tpl-block-body {
  display: grid;
  gap: 8px;
}

.tpl-block-body label {
  font-size: 12px;
  color: #cbd5e1;
}

.tpl-block-body input,
.tpl-block-body select,
.tpl-block-body textarea {
  background: #081121;
  color: #fff;
  border: 1px solid #334155;
  font-size: 13px;
  padding: 7px 10px;
}

/* Simulador de teléfono móvil */
.phone-mockup {
  width: min(100%, 356px);
  height: 640px;
  margin: 0 auto;
  border-radius: 34px;
  border: 8px solid #1e293b;
  background: #0b172a;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.phone-notch {
  width: 120px;
  height: 18px;
  background: #1e293b;
  border-radius: 0 0 12px 12px;
  margin: 0 auto;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
}

.phone-screen {
  flex: 1;
  overflow-y: auto;
  padding: 28px 14px 28px;
  background-size: cover;
  background-position: center;
  position: relative;
  color: #fff;
}

.tpl-bottom-bar {
  position: sticky;
  bottom: 10px;
  z-index: 20;
  margin-top: 16px;
  background: #07111f;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 6px;
  flex-wrap: wrap;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}

.tpl-bar-btn {
  background: transparent;
  color: #cbd5e1;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.tpl-bar-btn.active {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
}

.tpl-bar-btn.primary-bar {
  background: #0d9488;
  color: #fff;
}

/* =========================================================
   Auto-ajuste responsivo integral (Móvil + Vista embebida)
   ========================================================= */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.shell,
main,
.view,
.panel,
.hero-panel,
.table-panel {
  min-width: 0;
  max-width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.icon-btn .btn-label {
  font-style: normal;
}

.topbar {
  flex-wrap: wrap;
  gap: 10px 14px;
}

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

.top-actions {
  flex-wrap: wrap;
  min-width: 0;
}

.router-status-pill {
  max-width: 100%;
  overflow: hidden;
}

.router-status-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-head,
.template-item {
  flex-wrap: wrap;
}

.tpl-library-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

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

  .topbar {
    padding: 10px 14px;
    min-height: auto;
    gap: 8px 10px;
  }

  .topbar-title .eyebrow {
    font-size: 10px;
    margin-bottom: 2px;
  }

  .topbar-title h2 {
    font-size: 20px;
    line-height: 1.15;
  }

  .top-actions {
    width: 100%;
    margin-left: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
  }

  .top-actions #clock {
    display: none !important;
  }

  .top-actions .router-select {
    flex: 1 1 105px;
    min-width: 0;
    max-width: none;
    min-height: 36px;
    height: 36px;
    padding: 4px 8px;
    font-size: 12.5px;
  }

  .top-actions .router-status-pill {
    flex: 0 1 auto;
    min-width: 0;
    min-height: 36px;
    height: 36px;
    padding: 4px 10px;
    font-size: 11.5px;
  }

  .top-actions .icon-btn {
    flex: 0 0 36px;
    width: 36px;
    min-height: 36px;
    height: 36px;
    padding: 0 !important;
    font-size: 15px !important;
  }

  .top-actions .icon-btn .btn-label {
    display: none !important;
  }

  .top-actions .secondary::after {
    content: none !important;
  }

  .view {
    padding: 14px 14px 38px;
  }

  .hero-panel {
    padding: 18px 16px;
    min-height: auto;
    border-radius: 18px;
    gap: 12px;
    align-items: center;
  }

  .hero-panel h1 {
    font-size: clamp(22px, 6vw, 30px);
    margin: 2px 0 6px;
    line-height: 1.12;
  }

  .hero-panel .muted {
    font-size: 12.5px;
    line-height: 1.4;
    margin: 0;
  }

  .status-orb {
    min-width: 74px;
    width: 74px;
    height: 74px;
    flex-shrink: 0;
  }

  .status-orb span {
    font-size: 10px;
  }

  .status-orb strong {
    font-size: 13px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
    margin: 12px 0;
  }

  .metrics article {
    padding: 14px;
    border-radius: 14px;
    min-width: 0;
  }

  .metrics strong {
    font-size: clamp(20px, 5.5vw, 26px);
    margin: 6px 0 3px;
    overflow-wrap: anywhere;
  }

  .split,
  .section-grid,
  .card-list,
  .form-row,
  .accounting-filter-dates {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px;
  }

  .span-2 {
    grid-column: auto !important;
  }

  .panel {
    padding: 15px;
    border-radius: 15px;
  }

  .panel-head .filters {
    width: 100%;
  }

  .panel-head .filters input,
  .panel-head .filters select {
    flex: 1 1 140px;
    min-width: 0 !important;
  }

  .tpl-bar-btn {
    padding: 8px 10px;
    font-size: 12px;
    flex: 1 1 auto;
    text-align: center;
  }
}

/* Optimización extra cuando se visualiza dentro de la tarjeta iframe del Dashboard */
html.in-iframe .topbar {
  padding: 8px 12px;
  gap: 6px 8px;
}

html.in-iframe .view {
  padding: 12px 12px 28px;
}

html.in-iframe .hero-panel {
  padding: 14px 14px;
  border-radius: 16px;
}

html.in-iframe .metrics {
  gap: 8px;
  margin: 10px 0;
}

html.in-iframe .metrics article {
  padding: 12px;
}

/* =========================================================
   Animaciones en vivo del Simulador de Portal Hotspot
   ========================================================= */
.phone-screen {
  overflow-x: hidden;
}

.sim-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.sim-fx-aurora::before,
.sim-fx-aurora::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  filter: blur(42px);
  opacity: 0.45;
  animation: simAuroraMove 7s ease-in-out infinite alternate;
}

.sim-fx-aurora::before {
  top: -60px;
  left: -50px;
  background: var(--sim-accent, #0d9488);
}

.sim-fx-aurora::after {
  bottom: -40px;
  right: -50px;
  background: #38bdf8;
  animation-delay: -3.5s;
}

.sim-fx-orbs i {
  position: absolute;
  border-radius: 50%;
  filter: blur(22px);
  opacity: 0.42;
  background: var(--sim-accent, #ea580c);
  animation: simOrbFloat 6s ease-in-out infinite alternate;
}

.sim-fx-orbs i:nth-child(1) { width: 120px; height: 120px; top: 8%; left: -20px; }
.sim-fx-orbs i:nth-child(2) { width: 150px; height: 150px; top: 48%; right: -30px; background: #fbbf24; animation-delay: -2s; }
.sim-fx-orbs i:nth-child(3) { width: 100px; height: 100px; bottom: 6%; left: 20%; animation-delay: -4s; }

.sim-fx-radar i {
  position: absolute;
  top: 62px;
  left: 50%;
  width: 80px;
  height: 80px;
  margin-left: -40px;
  margin-top: -40px;
  border-radius: 50%;
  border: 2px solid var(--sim-accent, #3b82f6);
  opacity: 0;
  animation: simRadarRing 3.6s cubic-bezier(0.15, 0.8, 0.3, 1) infinite;
}

.sim-fx-radar i:nth-child(2) { animation-delay: 1.2s; }
.sim-fx-radar i:nth-child(3) { animation-delay: 2.4s; }

.sim-fx-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 26px 26px;
  animation: simGridScroll 8s linear infinite;
}

.sim-blk {
  animation: simFadeUp 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.sim-glass {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.38);
}

.sim-logo-pulse {
  animation: simLogoFloat 3.2s ease-in-out infinite;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45), 0 0 22px var(--sim-accent, rgba(59, 130, 246, 0.45));
}

.sim-btn-shimmer {
  position: relative;
  overflow: hidden;
}

.sim-btn-shimmer::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 65%;
  height: 100%;
  background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.42) 50%, transparent 80%);
  animation: simShimmer 3.2s infinite;
}

.sim-pos-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: simPosPing 1.8s infinite;
}

@keyframes simAuroraMove {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(35px, 28px) scale(1.22); }
}

@keyframes simOrbFloat {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-28px) scale(1.15); }
}

@keyframes simRadarRing {
  0% { transform: scale(0.7); opacity: 0.75; }
  100% { transform: scale(3.4); opacity: 0; }
}

@keyframes simGridScroll {
  0% { background-position: 0 0; }
  100% { background-position: 0 26px; }
}

@keyframes simFadeUp {
  0% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes simLogoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes simShimmer {
  0% { left: -120%; }
  45%, 100% { left: 160%; }
}

@keyframes simPosPing {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.75); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* VIP Badges, Modos de Tiempo, Cuotas y Modal */
.vip-badge {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.25), rgba(245, 158, 11, 0.35)) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.5) !important;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.plan-card-vip {
  border-color: rgba(245, 158, 11, 0.4) !important;
  box-shadow: 0 4px 20px -2px rgba(245, 158, 11, 0.12);
}

.pill-mode {
  background: rgba(147, 51, 234, 0.18) !important;
  color: #c084fc !important;
  border: 1px solid rgba(168, 85, 247, 0.35) !important;
}

.pill-quota {
  background: rgba(14, 165, 233, 0.18) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
}

.pill-speed {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #34d399 !important;
  border: 1px solid rgba(52, 211, 153, 0.35) !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.18s ease-out;
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-box {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}



