/* ==========================================================================
   FLEX DRIVERS — Panel post-login (web desktop)
   Reutiliza los tokens y utilidades de styles.css (--surface*, --volt, .btn…)
   ========================================================================== */

/* Estado global: cuando hay sesión activa en una ruta de panel */
body.panel-mode > .site-header,
body.panel-mode > .site-footer,
body.panel-mode > #contenido-principal,
body.panel-mode > .scroll-top-btn,
body.panel-mode > .modal-backdrop {
  display: none !important;
}

body.panel-mode {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Shell: sidebar + contenido
   -------------------------------------------------------------------------- */

.app-shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  height: 100vh;
  background: var(--surface-lowest);
  color: var(--text);
  font-family: var(--font-body);
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 16px;
  background: var(--surface-low);
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-strong);
  text-decoration: none;
  padding: 4px 8px;
}

.sidebar-brand .brand-accent {
  color: var(--volt);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-item:hover {
  background: var(--surface-container);
  color: var(--text-strong);
}

.nav-item.active {
  background: rgba(253, 228, 0, 0.1);
  color: var(--volt);
  border: 1px solid var(--volt-border);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user .user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.sidebar-user .user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-user .user-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .user-badge {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.dash-logout {
  color: var(--text-secondary);
}

.dash-logout:hover {
  color: var(--red);
}

/* --------------------------------------------------------------------------
   Contenido
   -------------------------------------------------------------------------- */

.panel-content {
  overflow-y: auto;
  padding: 32px 36px;
}

.panel-view[hidden] {
  display: none !important;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-strong);
  margin: 0 0 6px;
}

.panel-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 26px;
}

.panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 20px;
  color: var(--text-secondary);
  text-align: center;
}

.panel-error {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--red);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

/* --------------------------------------------------------------------------
   Pestaña Viajar
   -------------------------------------------------------------------------- */

.viajar-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.trip-card {
  background: var(--surface-low);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.trip-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-strong);
  margin: 0 0 16px;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 8px;
}

.trip-dest-input {
  width: 100%;
  background: var(--surface-container);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-strong);
  padding: 13px 16px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.15s ease;
}

.trip-dest-input:focus {
  border-color: var(--volt-border);
}

.trip-dest-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Tarjetas de servicio (service_tiers) */

.tier-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 22px 0;
}

.tier-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-container);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tier-card:hover {
  border-color: var(--volt-border);
}

.tier-card.selected {
  border-color: var(--volt);
  background: rgba(253, 228, 0, 0.08);
}

.tier-ico {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-high);
  color: var(--volt);
  flex-shrink: 0;
}

.tier-body {
  flex: 1;
  min-width: 0;
}

.tier-name {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-strong);
}

.tier-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.tier-meta {
  text-align: right;
  flex-shrink: 0;
}

.tier-price {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--volt);
}

.tier-price.muted {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.85rem;
}

.tier-seats {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.tier-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(253, 228, 0, 0.14);
  color: var(--volt);
  margin-bottom: 4px;
}

/* Método de pago y horario */

.pay-methods,
.schedule-toggle {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.pay-option,
.sched-option {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-container);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.pay-option.selected,
.sched-option.selected {
  border-color: var(--volt);
  color: var(--volt);
  background: rgba(253, 228, 0, 0.08);
}

/* Estado del viaje activo */

.trip-status-card {
  background: var(--surface-low);
  border: 1px solid var(--volt-border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
}

.trip-status-card .status-line {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-strong);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--volt);
  animation: pulse-dot 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.trip-status-card .status-detail {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.trip-status-card .status-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   Pestaña Billetera
   -------------------------------------------------------------------------- */

.wallet-balances {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.balance-card {
  background: var(--surface-low);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
}

.balance-card .balance-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.balance-card .balance-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-strong);
  margin-top: 6px;
}

.balance-card.usd .balance-value {
  color: var(--volt);
}

.balance-card.ves .balance-value {
  color: var(--green);
}

.method-card {
  background: var(--surface-low);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
}

.method-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-strong);
  margin: 0 0 14px;
}

/* --------------------------------------------------------------------------
   Pestaña Perfil
   -------------------------------------------------------------------------- */

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 24px;
  align-items: start;
}

.profile-card {
  background: var(--surface-low);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.profile-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-strong);
  margin: 0 0 18px;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.profile-head img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-head-ph {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface-container);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.profile-head .profile-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text-strong);
}

.profile-head .profile-sub {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 2px;
}

.profile-field {
  margin-bottom: 16px;
}

.profile-input {
  width: 100%;
  background: var(--surface-container);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-strong);
  padding: 12px 14px;
  font-size: 0.92rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.15s ease;
}

.profile-input:focus {
  border-color: var(--volt-border);
}

.profile-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.trip-history {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-container);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.history-item .hist-dest {
  font-weight: 600;
  color: var(--text-strong);
  font-size: 0.9rem;
}

.history-item .hist-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.hist-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.hist-status.completed { background: rgba(34, 197, 94, 0.14); color: var(--green); }
.hist-status.cancelled { background: rgba(239, 68, 68, 0.14); color: var(--red); }
.hist-status.active { background: rgba(253, 228, 0, 0.14); color: var(--volt); }

/* --------------------------------------------------------------------------
   Pestaña Chats
   -------------------------------------------------------------------------- */

.chats-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
  height: calc(100vh - 160px);
  min-height: 420px;
}

.chat-list {
  background: var(--surface-low);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  padding: 8px;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  transition: background 0.15s ease;
}

.chat-thread:hover {
  background: var(--surface-container);
}

.chat-thread.selected {
  background: rgba(253, 228, 0, 0.08);
  border-color: var(--volt-border);
}

.chat-thread .thread-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-thread .thread-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-strong);
}

.chat-thread .thread-time {
  font-size: 0.72rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.chat-thread .thread-last {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-thread .unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--volt);
  flex-shrink: 0;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  background: var(--surface-low);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chat-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-strong);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.msg-bubble.mine {
  align-self: flex-end;
  background: var(--volt);
  color: #11131c;
  border-bottom-right-radius: 4px;
}

.msg-bubble.theirs {
  align-self: flex-start;
  background: var(--surface-container);
  color: var(--text-strong);
  border-bottom-left-radius: 4px;
}

.msg-time {
  font-size: 0.68rem;
  opacity: 0.6;
  margin-top: 3px;
  display: block;
}

.chat-composer {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
}

.chat-composer input {
  flex: 1;
  background: var(--surface-container);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-strong);
  padding: 11px 14px;
  font-size: 0.92rem;
  font-family: var(--font-body);
  outline: none;
}

.chat-composer input:focus {
  border-color: var(--volt-border);
}

/* --------------------------------------------------------------------------
   Placeholder (panel de conductor)
   -------------------------------------------------------------------------- */

.soon-card {
  background: var(--surface-low);
  border: 1px dashed var(--volt-border);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  color: var(--text-secondary);
}

.soon-card h3 {
  font-family: var(--font-display);
  color: var(--text-strong);
  margin: 0 0 8px;
}

.kyc-chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 12px;
}

.kyc-chip.approved { background: rgba(34, 197, 94, 0.14); color: var(--green); }
.kyc-chip.in_review { background: rgba(253, 228, 0, 0.14); color: var(--volt); }
.kyc-chip.rejected { background: rgba(239, 68, 68, 0.14); color: var(--red); }
.kyc-chip.pending { background: var(--surface-high); color: var(--text-secondary); }

/* --------------------------------------------------------------------------
   Responsive (espeja breakpoints de styles.css)
   -------------------------------------------------------------------------- */

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .app-sidebar {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sidebar-brand span {
    display: none;
  }

  .sidebar-nav {
    flex-direction: row;
    gap: 2px;
  }

  .nav-item {
    padding: 9px 12px;
    font-size: 0.85rem;
  }

  .nav-item span {
    display: none;
  }

  .sidebar-footer {
    flex-direction: row;
    align-items: center;
    border-top: none;
    padding-top: 0;
    margin-left: auto;
  }

  .sidebar-user .user-info {
    display: none;
  }

  .dash-logout {
    width: auto;
  }

  .viajar-grid {
    grid-template-columns: 1fr;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .chats-grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .chat-list {
    max-height: 220px;
  }

  .chat-panel {
    min-height: 380px;
  }

  .panel-content {
    padding: 20px 16px;
  }
}

/* ==========================================================================
   Correcciones y módulo de puntos / recompensas
   ========================================================================== */

/* El atributo hidden no ocultaba nada porque .nav-item declara display:flex
   (una regla de autor gana al [hidden] del navegador). */
.nav-item[hidden] {
  display: none !important;
}

/* Foco visible real: los inputs lo anulaban con outline:none y dejaban un
   borde de 2.79:1, por debajo del 3:1 que exige WCAG 1.4.11. */
.trip-dest-input:focus-visible,
.profile-input:focus-visible,
.chat-composer input:focus-visible {
  outline: 2px solid var(--volt);
  outline-offset: 1px;
  border-color: var(--volt);
}

/* Objetivos táctiles de 44 px (antes 40-43 px) */
.pay-option,
.sched-option {
  min-height: 44px;
}

.panel-content .btn-sm,
.sidebar-footer .btn-sm {
  min-height: 44px;
}

/* Contraste: los tres rojos quedaban por debajo de 4.5:1 */
.panel-error {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.45);
}

.hist-status.cancelled {
  color: #fca5a5;
}

.kyc-chip.rejected {
  color: #fca5a5;
}

/* --------------------------------------------------------------------------
   Anillo de nivel alrededor del avatar
   -------------------------------------------------------------------------- */

.avatar-ring {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  text-decoration: none;
}

.avatar-ring:focus-visible {
  outline: 2px solid var(--volt);
  outline-offset: 3px;
}

.ring-svg {
  position: absolute;
  inset: 0;
  width: 48px;
  height: 48px;
  transform: rotate(-90deg);
  pointer-events: none;
}

.ring-track,
.ring-progress {
  fill: none;
  stroke-width: 3;
}

.ring-track {
  stroke: rgba(255, 255, 255, 0.13);
}

.ring-progress {
  stroke: var(--volt);
  stroke-linecap: round;
  stroke-dasharray: 131.95;
  stroke-dashoffset: 131.95;
  transition: stroke-dashoffset 0.6s ease, stroke 0.3s ease;
}

.avatar-ring .user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: none;
  background: var(--surface-low);
}

.ring-level {
  position: absolute;
  right: -2px;
  bottom: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--volt);
  color: var(--on-volt);
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1;
  border: 2px solid var(--surface-low);
}

/* Color del anillo según el nivel de la cuenta */
.avatar-ring[data-level="plata"] .ring-progress { stroke: #cbd5e1; }
.avatar-ring[data-level="oro"] .ring-progress { stroke: var(--volt); }
.avatar-ring[data-level="platino"] .ring-progress { stroke: #7dd3fc; }

.avatar-ring[data-level="plata"] .ring-level { background: #cbd5e1; }
.avatar-ring[data-level="oro"] .ring-level { background: var(--volt); }
.avatar-ring[data-level="platino"] .ring-level { background: #7dd3fc; }

.sidebar-user .user-points {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--volt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Variante grande del anillo (cabecera del perfil) */
.avatar-ring.ring-lg {
  width: 72px;
  height: 72px;
}

.avatar-ring.ring-lg .ring-svg {
  width: 72px;
  height: 72px;
}

.avatar-ring.ring-lg .user-avatar {
  width: 58px;
  height: 58px;
}

.avatar-ring.ring-lg .ring-level {
  min-width: 22px;
  height: 22px;
  font-size: 0.68rem;
}

.profile-points {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--volt);
  margin-top: 2px;
}

/* Los mensajes multilínea conservaban los saltos solo en teoría */
.msg-bubble {
  white-space: pre-wrap;
  word-break: break-word;
}

/* --------------------------------------------------------------------------
   Vista Recompensas
   -------------------------------------------------------------------------- */

.rewards-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 20px;
  margin-bottom: 26px;
}

.points-card,
.level-card {
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid rgba(253, 228, 0, 0.28);
  background:
    radial-gradient(circle at 88% 8%, rgba(253, 228, 0, 0.14), transparent 52%),
    var(--surface-container);
}

.level-card {
  border-color: rgba(255, 255, 255, 0.1);
  background: var(--surface-container);
}

.points-eyebrow,
.level-eyebrow {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.points-big {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.1rem, 4vw, 2.8rem);
  line-height: 1;
  color: var(--text-strong);
}

.points-big small {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--volt);
  letter-spacing: 0.02em;
}

.points-hint {
  margin: 10px 0 0;
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.level-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.45rem;
  color: var(--text-strong);
  margin-bottom: 6px;
}

.level-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--volt);
  box-shadow: 0 0 12px rgba(253, 228, 0, 0.7);
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin: 12px 0 8px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--volt);
  transition: width 0.6s ease;
}

.level-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.rewards-banner {
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(253, 228, 0, 0.4);
  background: rgba(253, 228, 0, 0.06);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.rewards-banner strong {
  color: var(--volt);
}

.rewards-section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-strong);
  margin: 0 0 14px;
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.reward-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface-container);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.reward-item:hover {
  border-color: rgba(253, 228, 0, 0.32);
  transform: translateY(-2px);
}

.reward-item.is-owned {
  border-color: rgba(34, 197, 94, 0.4);
}

.reward-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(253, 228, 0, 0.12);
  border: 1px solid rgba(253, 228, 0, 0.22);
  color: var(--volt);
}

.reward-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reward-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-strong);
  line-height: 1.25;
}

.reward-badge {
  flex-shrink: 0;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(253, 228, 0, 0.14);
  color: var(--volt);
  white-space: nowrap;
}

.reward-desc {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.reward-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 10px;
}

.reward-cost {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-strong);
  white-space: nowrap;
}

.reward-cost span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.reward-item .btn {
  width: 100%;
  min-height: 42px;
  font-size: 0.85rem;
  padding-inline: 10px;
}

/* Un canje no disponible no debe parecer pulsable */
.reward-item .btn:disabled,
.reward-item .btn[disabled] {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
  transform: none;
}

.reward-item.is-locked {
  opacity: 0.92;
}

.reward-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--volt);
  background: rgba(253, 228, 0, 0.1);
  border-radius: 8px;
  padding: 6px 10px;
  text-align: center;
}

.rewards-history {
  margin-top: 26px;
}

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.85rem;
}

.history-row:last-child {
  border-bottom: none;
}

.history-row .delta-pos {
  color: var(--green);
  font-weight: 700;
}

.history-row .delta-neg {
  color: #fca5a5;
  font-weight: 700;
}

@media (max-width: 960px) {
  .rewards-hero {
    grid-template-columns: 1fr;
  }
}

