:root {
  --bg: #0f1724;
  --card: #0b1220;
  --muted: #9aa4b2;
  --accent: #ffcc00;
  --accent-2: #00bcd4;
  --header-height: 56px;
  --bottom-nav-height: 56px
}

* {
  box-sizing: border-box;
  font-family: Inter, system-ui, Arial, Helvetica, sans-serif
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #071028 0%, #071428 100%);
  color: #e6eef6
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px
}

.site-header {
  background: rgba(7, 12, 20, 0.6);
  backdrop-filter: blur(6px);
  padding: 3px 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 24px
}

.logo {
  margin: 0;
  font-size: 22px;
  color: var(--accent)
}

/* Logo variant when used inside the hero (centered and slightly larger) */
.hero>.container>.logo {
  display: block;
  margin: 0 auto 12px auto;
  font-size: 28px;
  text-align: center
}

/* Keep header logo compact */
.site-header .logo {
  font-size: 18px
}

/* Menu toggle (left of logo) */
.menu-toggle {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-size: 20px;
  cursor: pointer;
  margin-right: 0px;
  padding: 6px 8px;
  border-radius: 6px
}

.menu-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.08)
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0
}

/* Side menu that slides right from the left toggle */
.side-menu {
  position: fixed;
  left: 8px;
  right: auto;
  top: calc(var(--header-height) + 12px);
  bottom: var(--bottom-nav-height);
  width: 260px;
  max-width: 80vw;
  background: rgba(7, 12, 20, 0.98);
  color: var(--muted);
  border-radius: 10px;
  padding: 8px 6px;
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.5);
  transform: translateX(-100vw);
  transition: transform .22s ease;
  z-index: 95;
  overflow: auto
}

.side-menu.open {
  transform: translateX(0)
}

.side-menu:not(.open):not(.visible),
#sideMenu[aria-hidden="true"] {
  pointer-events: none;
  /* prevent invisible menu from receiving hover/click */
  touch-action: none;
}

.side-menu ul {
  list-style: none;
  margin: 0;
  padding: 6px
}

.side-menu li {
  padding: 10px 12px;
  border-radius: 8px;
  margin: 6px 0;
  cursor: pointer;
  color: var(--muted)
}

.side-menu li:hover {
  background: rgba(255, 255, 255, 0.02);
  color: #fff
}

.side-menu li.active {
  background: rgba(255, 255, 255, 0.03);
  color: var(--accent);
  font-weight: 700
}

/* Nav at right, matching container padding distance from edge */
.nav {
  display: flex;
  align-items: center;
  gap: 12px
}

.greeting {
  color: var(--muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis
}

.hero {
  padding: 5px 0;
  display: flex;
  align-items: center;
  flex: 1
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 320px;
  grid-template-areas: 'logo logo' 'left right';
  gap: 24px;
  align-items: start
}

.hero>.container>picture {
  grid-area: logo;
  grid-column: 1 / -1;
  justify-self: stretch;
  width: 100%;
  text-align: center;
  margin: 0 0 12px 0;
  margin-top: 8px;
}

.hero>.container>picture>.logo {
  display: block;
  margin: 0 auto 12px auto;
}

.hero-left {
  grid-area: left;
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
  grid-column: 1 / -1;
  justify-self: center
}

.hero-right {
  grid-area: right
}

/* Center call-to-action row inside the left hero column */
.hero-left .cta-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 12px
}

/* Responsive H2 in hero-left: keep max h2 but don't shrink too much; center and allow wrapping */
.hero-left h2 {
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  line-height: 1.05;
  margin: 0 0 8px 0;
  text-align: center;
  white-space: normal;
  overflow: visible;
  display: block;
  color: var(--accent);
  background: linear-gradient(90deg, rgba(255, 204, 0, 0.08), rgba(255, 255, 255, 0.01));
  padding: 6px 3px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.25);
  letter-spacing: 0.2px;
  font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.hero-left h2:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.32);
  opacity: 0.98;
}

.demo-card {
  background: rgba(255, 255, 255, 0.03);
  padding: 18px;
  border-radius: 10px
}

.btn {
  border: 0;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  background-color: rgba(255, 255, 255, 0.02);
  text-decoration: none
}

.btn.small {
  padding: 6px 10px;
  font-size: 13px
}

.btn.primary {
  background: var(--accent);
  color: #072031
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted)
}

/* Additional button variants */
.btn.danger {
  background: #ef4444;
  color: #ffffff
}

.btn.danger:hover {
  filter: brightness(0.95)
}

.btn.success {
  background: #10b981;
  color: #012018
}

.btn.success:hover {
  filter: brightness(0.98)
}

.btn.secondary {
  background: #6b7280;
  color: #ffffff
}

.btn.secondary:hover {
  filter: brightness(0.96)
}

/* subtle hover for neutral buttons only — don't override color of variant buttons (use hyphenated names) */
.btn:not(.btn-primary):not(.btn-danger):not(.btn-success):not(.btn-secondary):hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: #ffffff
}

/* Keep variant button hover behavior focused on brightness rather than overlay */
.btn.btn-primary:hover {
  filter: brightness(0.98)
}

.btn.btn-danger:hover {
  filter: brightness(0.95)
}

.btn.btn-success:hover {
  filter: brightness(0.98)
}

.btn.btn-secondary:hover {
  filter: brightness(0.96)
}

/* Ghost buttons: keep subtle border on hover */
.btn.btn-ghost,
.btn.ghost {}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.10);
  color: #ffffff
}

/* Ensure hyphenated variant classes keep intended colors (match .btn.primary earlier rules) */
.btn.btn-primary,
.btn-primary {
  background: var(--accent) !important;
  color: #072031 !important;
  border-color: transparent !important;
}

.btn.btn-danger,
.btn-danger {
  background: #ef4444 !important;
  color: #ffffff !important;
}

.btn.btn-success,
.btn-success {
  background: #10b981 !important;
  color: #012018 !important;
}

.btn.btn-secondary,
.btn-secondary {
  background: #6b7280 !important;
  color: #ffffff !important;
}

/* Provide stronger focus styles for accessibility */
.btn:focus {
  outline: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35)
}

.btn.primary:focus {
  box-shadow: 0 6px 20px rgba(255, 204, 0, 0.16)
}

/* Highlight animation for balances when updated (flash yellow then return) */
@keyframes flashAccent {
  0% {
    color: inherit;
    background: transparent;
    box-shadow: none;
  }

  20% {
    color: #072031;
    background: var(--accent);
    box-shadow: 0 8px 28px rgba(255, 204, 0, 0.18);
  }

  100% {
    color: inherit;
    background: transparent;
    box-shadow: none;
  }
}

.flash-accent {
  animation: flashAccent 3s ease forwards;
  border-radius: 4px;
  padding: 0 6px;
}

.wallet {
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
  border-radius: 6px;
  margin: 2px 0
}

/* Transactions list: collapsed by default (shows up to 4), expands to show all (up to 10) */
#txList {
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02)
}

#txList.expanded {
  max-height: none;
  overflow: visible
}

/* Transaction separator using an <hr> element inserted between rows */
.tx-sep {
  height: 1px;
  border: 0;
  background: rgba(255, 255, 255, 0.52);
  margin: 8px 0;
  border-radius: 2px
}

.hr-sep {
  height: 1px;
  border: 0;
  background: rgba(255, 255, 255, 0);
  margin: 8px 0;
  border-radius: 2px;
  max-width: 50%;
  margin-left: auto;
  margin-right: auto
}

/* Currency input styling: show entered amount in bold, placeholder darker */
#loadAmount,
#withdrawAmount {
  font-weight: 700;
}

#loadAmount::placeholder,
#withdrawAmount::placeholder {
  font-weight: 400;
  color: #4a4a4a;
  opacity: 1;
}

/* Fallback: apply dark-gray placeholder globally for inputs and textareas */
input::placeholder,
textarea::placeholder {
  color: #4a4a4a;
  opacity: 1;
}

input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
  color: #4a4a4a;
}

input::-ms-input-placeholder,
textarea::-ms-input-placeholder {
  color: #4a4a4a;
}

.password-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

.password-wrapper input {
  width: 100%;
  padding-right: 44px;
  box-sizing: border-box;
}

.toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px
}

.result {
  margin-top: 8px;
  min-height: 26px
}

.features {
  margin-top: 20px
}

.leaderboard {
  margin: 28px 0
}

.site-footer {
  margin-top: auto;
  padding: 18px 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.85rem;
  position: relative;
  z-index: 85;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #071028 0%, #071428 100%) !important;
  backdrop-filter: blur(4px) !important;
  padding: 20px;
  overflow: auto
}

.modal.hidden {
  display: none
}

/* Force backdrop to app gradient and ensure modal-content shows a translucent surface */
.modal-backdrop.show {
  background: linear-gradient(180deg, #071028 0%, #071428 100%) !important;
  opacity: 0.95 !important;
  /* z-index: 10990 !important; */
}

.modal-content {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.04) !important;
  max-width: 480px !important;
  padding: 15px !important;
}

/* Modal title in primary (accent) color */
.modal-content h3 {
  color: var(--accent);
  margin: 0 0 6px 0;
  font-weight: 700
}

/* Mensaje dentro del modal: fuente un punto más grande */
.modal-content p {
  font-size: 19px;
  line-height: 1.4;
  margin: 0 0 8px 0
}

.auth .field {
  margin-bottom: 10px
}

.auth .field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px
}

.auth input[type="text"],
.auth input[type="email"],
.auth input[type="password"],
.auth input[type="date"],
.auth input[type="number"],
.auth input[type="tel"],
.auth select,
.auth textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.015);
  color: inherit
}

.auth input[type="checkbox"] {
  width: auto;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle
}

.auth select {
  appearance: none
}

.auth input:focus,
.auth select:focus,
.auth textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35)
}

/* Enlaces dentro de formularios de autenticación */
.auth a {
  color: var(--muted);
  text-decoration: none
}

.auth a:hover {
  color: #ffffff;
  text-decoration: underline
}

/* Forzar colores de las opciones del select (mejor legibilidad) */
.auth select {
  background: rgba(255, 255, 255, 0.015);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.06);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none
}

/* Closed select matches other inputs (oscuro). Dropdown options use fondo claro y texto negro para legibilidad. */
.auth select option {
  background: #f3f4f6;
  color: #0b0b0b
}

.auth select::-ms-expand {
  display: none
}

.actions .btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px
}

.errors {
  background: rgba(255, 0, 0, 0.06);
  color: #ffdddd;
  padding: 8px;
  border-radius: 8px;
  margin: 8px 0
}

/* Custom select styles */
.custom-select {
  position: relative
}

.custom-select__trigger {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.015);
  color: inherit;
  cursor: pointer
}

.custom-select.open .custom-select__trigger {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  border-color: var(--accent)
}

.custom-select__options {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: #f3f4f6;
  color: #0b0b0b;
  border-radius: 8px;
  max-height: 240px;
  overflow: auto;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.4);
  z-index: 50;
  padding: 6px;
  display: none
}

.custom-select.open .custom-select__options {
  display: block
}

.custom-select__option {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer
}

.custom-select__option:hover {
  background: rgba(0, 0, 0, 0.06)
}

.custom-select__option[aria-selected="true"] {
  font-weight: 600
}

@media (max-width: 800px) {
  .hero {
    padding: 12px 0;
  }

  .hero .container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "logo"
      "left"
      "right";
    gap: 18px;
    align-items: start;
    padding: 0 12px;
    margin-top: -10px;
  }

  .hero>.container>picture {
    grid-area: logo;
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
    text-align: center;
    margin-bottom: 8px;
  }

  .hero>.container>picture>.logo {
    display: block;
    margin: 0 auto 8px auto;
  }

  .hero-left {
    grid-area: left
  }

  .hero-right {
    grid-area: right;
    width: 100%
  }
}

/* Responsive: make buttons behave like btn-sm on small screens */
@media (max-width: 576px) {
  .btn {
    /* padding: 6px 10px !important; */
    font-size: 13px !important;
    border-radius: 8px !important;
  }

  .btn.small {
    padding: 4px 8px !important;
    font-size: 12px !important;
  }

  .btn.primary {
    padding: 6px 10px !important;
  }
}

/* Mobile: align the more (...) button to the right edge of the bottom nav */
@media (max-width: 576px) {
  .bottom-nav ul {
    align-items: center;
    justify-content: center;
    padding-right: 64px;
  }

  /* Pin the .more button to the right so it doesn't affect centering */
  .bottom-nav li.more {
    position: absolute;
    right: 0px;
    top: 8%;
    transform: translateY(-50%);
    margin-left: 0;
    margin-right: 0;
  }
}

/* Desktop: make bottom-nav match the centered .container width */
@media (min-width: 800px) {
  .bottom-nav {
    left: 0;
    right: 0;
    width: 100%;
    max-width: 980px;
    /* same as .container */
    margin: 0 auto;
    padding: 0 24px;
    /* match .container horizontal padding */
    border-radius: 12px 12px 0 0;
    z-index: 80;
  }

  .bottom-nav ul {
    padding: 6px 0;
  }

  /* Align side-menu with the centered container/menuToggle on wide screens */
  .side-menu {
    left: calc(50% - 490px + 24px);
    /* centers relative to max-width 980px and container padding 24px */
    right: auto;
    top: calc(var(--header-height) + 12px);
    max-width: 260px;
  }

  /* Dropdown variant: on large screens we can show the menu as a small dropdown from the toggle */
  .side-menu.dropdown {
    transform-origin: top left;
    transform: translateY(-12px) !important;
    opacity: 0;
    pointer-events: none;
    transition: transform .22s cubic-bezier(.2, .9, .2, 1), opacity .18s ease;
    z-index: 210;
    border-radius: 8px;
    width: 260px;
    max-width: 80vw;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.45);
  }

  .side-menu.dropdown.visible,
  .side-menu.dropdown.open {
    /* visible state */
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

/* Popover for hidden bottom-nav items (appears upwards) */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  bottom: constant(safe-area-inset-bottom);
  background: rgba(7, 20, 36, 0.95);
  color: #e6eef6;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  z-index: 80;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px))
}

.bottom-nav .more {
  min-width: 44px;
  text-align: center;
  cursor: pointer;
  color: var(--accent);
  font-weight: 900;
  font-size: 18px;
  padding: 6px 8px;
  border-radius: 8px
}

.bottom-nav .more:focus {
  outline: none
}

.more-popup {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  background: rgba(20, 30, 40, 0.995);
  color: #ffffff;
  border-radius: 10px 10px 6px 6px;
  padding: 8px;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.75);
  z-index: 120;
  max-width: 92vw;
  min-width: 150px
}

.more-popup ul {
  list-style: none;
  margin: 0;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px
}

.more-popup li {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  color: #e6eef6;
  font-size: 15px
}

.more-popup li:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #fff
}

.more-popup li+li {
  border-top: 1px solid rgba(255, 255, 255, 0.03)
}

.more-popup.hidden {
  display: none
}

/* Hide spinner arrows on numeric inputs */
/* Chrome, Safari, Edge, Opera */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
  display: none !important;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield !important;
  appearance: textfield !important;
  -webkit-appearance: textfield !important;
  -webkit-appearance: none !important;
}

/* Ensure numeric inputs visually match other inputs */
input[type=number],
input[type="number"] {
  appearance: none !important;
  -moz-appearance: textfield !important;
  -webkit-appearance: none !important;

  /* Transaction status badges */
  .tx-status {
    display: inline-block;
    padding: 4px 6px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    background: transparent
  }

  .tx-status.processed {
    background: transparent;
    color: #16a34a
  }

  .tx-status.deleted {
    background: transparent;
    color: #7f1d1d
  }

  .tx-status.pending {
    background: transparent;
    color: #f59e0b
  }

  /* Center column headers for tables shown inside modals */
  .modal table thead th,
  .modal .table thead th,
  .modal table th,
  .modal .table th {
    text-align: center;
  }

  /* Estilos para enlace Administrar en el side menu */
  .side-menu li.admin-sep {
    padding: 0;
    margin: 10px 0 6px 0;
    list-style: none
  }

  .side-menu li.admin-sep hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.02));
    margin: 0
  }

  .side-menu .admin-item {
    margin-top: 4px
  }

  .side-menu a.admin-link {
    display: block;
    padding: 8px 12px;
    color: #f59e0b;
    text-decoration: none !important;
    font-weight: 600;
    border-radius: 6px
  }

  .side-menu a.admin-link:hover {
    background: rgba(245, 158, 11, 0.06);
    color: #b45309;
    text-decoration: none !important
  }
}

/* Also hide on desktop browsers that use ::-webkit-outer-spin-button on inputs without type set */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  display: none !important;
}

/* Extra fallback CSS: refuerzo final para navegadores reacios */
input[type=number] {
  -webkit-appearance: textfield !important;
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  display: none !important;
  visibility: hidden !important;
}

/* Prevent spinner on Edge/IE-like engines */
input[type=number]::-ms-clear,
input[type=number]::-ms-expand {
  display: none !important;
}

/* Views slider */
.views {
  position: relative;
  overflow-y: hidden;
  overflow-x: hidden;
  height: calc(var(--app-height, 100vh) - var(--header-height) - (var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px)));
  min-height: 300px
}

.views-track {
  display: flex;
  transition: transform .35s ease;
  width: 100%;
  height: 100%
}

.view {
  flex: 0 0 100%;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 8px)
}

/* Blank view is inserted as a real .view.blank inside the .views-track */

/* Bottom nav */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 12px;
  bottom: constant(safe-area-inset-bottom);
  background: rgba(7, 20, 36, 0.95);
  color: #e6eef6;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  z-index: 60;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px))
}

.bottom-nav ul {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 6px 8px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  justify-content: center;
  align-items: center
}

.bottom-nav li {
  flex: 0 0 auto;
  min-width: 64px;
  padding: 2px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  text-align: center
}

.bottom-nav li.active {
  background: rgba(255, 255, 255, 0.03);
  color: var(--accent);
  font-weight: 700
}

/* Hide some bottom-nav items unless they become active (used for views reachable only from side menu) */
.bottom-nav li.hidden-unless-active {
  display: none
}

.bottom-nav li.hidden-unless-active.active {
  display: inline-flex
}

/* Resultados de sorteos */
.resultados-shell {
  padding: 18px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
}

.resultados-panel {
  background: linear-gradient(180deg, rgba(11, 24, 40, 0.96), rgba(8, 18, 31, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  width: 100%;
}

.resultados-filtros {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.resultados-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 14px;
}

.resultados-card + .resultados-card {
  margin-top: 12px;
}

.resultados-loteria {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 12px;
  height: 100%;
}

.resultados-loteria-title {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 6px;
  margin-bottom: 10px;
  font-weight: 700;
  color: #7fb7fd;
}

.resultados-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.resultados-posiciones {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resultados-posicion-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.resultados-posiciones-dobles {
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.resultados-doble-tabla {
  width: auto;
  margin: 0 auto;
  border-collapse: separate;
  border-spacing: 8px 6px;
}

.resultados-doble-tabla td {
  vertical-align: middle;
  white-space: nowrap;
}

.resultados-doble-tabla td:nth-child(1),
.resultados-doble-tabla td:nth-child(3) {
  width: 28px;
  text-align: right;
}

/* Abre el canal central entre las dos columnas (1-10 | 11-20) */
.resultados-doble-tabla td:nth-child(2) {
  padding-right: 35px;
}

.resultados-doble-tabla td:nth-child(3) {
  padding-left: 35px;
}

.resultados-posiciones-fila {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.resultados-posicion-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 30px;
}

.resultados-posicion-pair-empty {
  visibility: hidden;
}

.resultados-posicion-row.is-match .resultado-posicion-indice,
.resultados-posicion-row.is-match .resultado-posicion-label,
.resultados-posicion-pair.is-match .resultado-posicion-indice {
  color: #ffda6a;
}

.resultados-posicion-pair.is-match .resultado-chip {
  background: linear-gradient(135deg, #ffda6a, #ffb84d);
  color: #12202f;
  box-shadow: 0 6px 18px rgba(255, 184, 77, 0.24);
}

.resultado-posicion-indice {
  min-width: 24px;
  text-align: center;
  font-weight: 800;
  color: #f2f6fb;
}

.resultado-posicion-label {
  min-width: 110px;
  color: #ece2e4bd;
  font-size: 0.88rem;
}

.resultado-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #eef5fb;
  font-weight: 700;
  font-size: 0.88rem;
}

.resultado-chip.is-match {
  background: linear-gradient(135deg, #ffda6a, #ffb84d);
  color: #12202f;
  box-shadow: 0 6px 18px rgba(255, 184, 77, 0.24);
}

.resultados-empty {
  text-align: center;
  color: #ece2e4bd;
  padding: 26px 10px;
}

.resultados-meta {
  color: #ece2e4bd;
  font-size: 0.88rem;
}

@media (max-width: 900px) {
  .resultados-filtros {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 410px) {
  .resultados-shell {
    padding: 12px;
  }

  .resultados-acciones {
    justify-content: center;
    margin-top: 8px;
    margin-bottom: 8px;
  }

  .resultados-panel {
    padding: 12px;
    border-radius: 16px;
  }

  .resultados-filtros {
    grid-template-columns: 1fr;
  }

  .resultados-posiciones-dobles {
    width: 100%;
  }

  .resultados-doble-tabla {
    border-spacing: 4px 5px;
  }

  .resultados-doble-tabla td:nth-child(2) {
    padding-right: 35px;
  }

  .resultados-doble-tabla td:nth-child(3) {
    padding-left: 35px;
  }

  .resultado-posicion-indice {
    min-width: 20px;
    font-size: 0.82rem;
  }

  .resultado-chip {
    min-width: 40px;
    padding: 3px 8px;
    font-size: 0.82rem;
  }
}

@media (max-width: 350px) {
  .resultados-shell {
    padding: 12px;
  }

  .resultados-acciones {
    justify-content: center;
    margin-top: 8px;
    margin-bottom: 8px;
  }

  .resultados-panel {
    padding: 12px;
    border-radius: 16px;
  }

  .resultados-filtros {
    grid-template-columns: 1fr;
  }

  .resultados-posiciones-dobles {
    width: 100%;
  }

  .resultados-doble-tabla {
    border-spacing: 4px 5px;
  }

  .resultados-doble-tabla td:nth-child(2) {
    padding-right: 15px;
  }

  .resultados-doble-tabla td:nth-child(3) {
    padding-left: 15px;
  }

  .resultado-posicion-indice {
    min-width: 20px;
    font-size: 0.82rem;
  }

  .resultado-chip {
    min-width: 40px;
    padding: 3px 8px;
    font-size: 0.82rem;
  }
}

/* Optional: hide native scrollbar but keep scrollable (WebKit) */
.bottom-nav ul::-webkit-scrollbar {
  height: 6px
}

.bottom-nav ul::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px
}

.bottom-nav ul::-webkit-scrollbar-track {
  background: transparent
}

/* ensure content above bottom nav and header */
/* Respect device safe area (notch/curved screens) when reserving space for bottom nav */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: var(--header-height);
  padding-bottom: env(safe-area-inset-bottom, 0px)
}

/* Utility classes similares a Bootstrap */
.fw-bold {
  font-weight: 700 !important;
}

.fw-bolder {
  font-weight: 800 !important;
}

.text-bold {
  font-weight: 700 !important;
}

/* Font-size utilities (compatible con clase Bootstrap .fs-1 .. .fs-6) */
.fs-1 {
  font-size: 2.5rem !important;
}

.fs-2 {
  font-size: 2rem !important;
}

.fs-3 {
  font-size: 1.75rem !important;
}

.fs-4 {
  font-size: 1.5rem !important;
}

.fs-5 {
  font-size: 1.25rem !important;
}

.fs-6 {
  font-size: 1rem !important;
}

/* Opciones más pequeñas */
.fs-sm {
  font-size: 0.875rem !important;
}

.fs-xs {
  font-size: 0.75rem !important;
}

/* Refuerzo global para el enlace Administrar: aplica incluso fuera de .side-menu */
a.admin-link,
a.admin-link:link,
a.admin-link:visited,
.admin-link {
  color: #f59e0b !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

a.admin-link:hover,
.admin-link:hover {
  color: #b45309 !important;
  text-decoration: none !important;
}

/* Fallback: ensure admin modal border shows even if admin.css isn't loaded or is overridden */
#adminUserActionModal .admin-modal-dialog {
  border: 2px solid #ef4444 !important;
  box-shadow: 0 16px 48px rgba(239, 68, 68, 0.08) !important;
}

/* Also target Bootstrap-style modal structure used in admin users index */
#adminUserActionModal .modal-content {
  border: 2px solid #ef4444 !important;
  box-shadow: 0 16px 48px rgba(239, 68, 68, 0.08) !important;
  border-radius: 10px !important;
}

/* Ensure admin modal-content scrolls internally on small screens */
#adminUserActionModal .modal-content {
  max-height: calc(100vh - 160px) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Prevent monetary amounts from breaking across lines inside modals */
.movimientos-list .h5,
.movimientos-list .card .h5,
.movimientos-list td.text-end {
  white-space: nowrap !important;
}
/* Nav tabs: inactive muted, active dark */
.nav-tabs .nav-link { color: #a5b1c3; font-weight: 500; }
.nav-tabs .nav-link.active,
.nav-tabs .nav-link:hover { color: #111; font-weight: 700; }
