* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f7f7fb;
  color: #151526;
}

.app {
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 18px;
Padding-bottom: 110px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f7fb 100%);
}

.top {
  text-align: left;
  margin-bottom: 24px;
}

.top h1 {
  font-size: 38px;
  margin: 0;
  color: #5b2eff;
}

.top p {
  font-size: 16px;
  color: #555;
  margin-top: 8px;
}

.card {
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  border: 1px solid rgba(255,255,255,0.4);

  box-shadow:
    0 8px 30px rgba(91,46,255,0.08);

  border-radius: 28px;
}

.card h2 {
  margin-top: 0;
  font-size: 22px;
}

input, select {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #ddd;
  margin-bottom: 12px;
  font-size: 15px;
}

button {
  width: 100%;
  background: #5b2eff;
  color: white;
  border: none;
  padding: 15px;
  border-radius: 15px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
margin-top: 12px;
display: block;
}

button:hover {
  opacity: 0.9;
}


.balance-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;

  padding: 18px 0;

  border-bottom: 1px solid #ececec;
}

.green {
  color: #38b66b;
  font-weight: bold;
}

.red {
  color: #e94057;
  font-weight: bold;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 15px;
}

.checkbox-item input {
  width: auto;
  margin: 0;
}
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  
  width: calc(100% - 90px);
  max-width: 360px;

  display: flex;
  justify-content: space-around;
  align-items: center;

  padding: 8px 6px;

  border-radius: 22px;

  background: rgba(255,255,255,0.45);

  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);

  border: 1px solid rgba(255,255,255,0.4);

  box-shadow:
    0 8px 24px rgba(0,0,0,0.08),
    inset 0 1px 1px rgba(255,255,255,0.4);

  z-index: 99999;
}

.nav-item {
  width: 68px;
  height: 58px;

  border-radius: 16px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 2px;

  font-size: 13px;

  color: #777;

  transition: all 0.2s ease;
}
.nav-item.active {
  background: rgba(91,46,255,0.12) !important;
  color: #5b2eff !important;

  transform: translateY(-2px);

  box-shadow:
    0 6px 14px rgba(91,46,255,0.12);
}
.secondary-button {
  background: #38b66b;
  margin-top: 10px;
}
.danger-button {
  background: #e94057;
  margin-top: 10px;
}
.danger-button-small {
  background: #e94057;
  width: auto;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 10px;
}
.balance-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
}
/* Botón pequeño eliminar */

.balance-item button {
  width: auto;
  min-width: 50px;

  padding: 10px 16px;

  border-radius: 14px;

  font-size: 15px;
}

/* Botón abrir grupo */

.balance-item button:not(.danger-button-small) {
  min-width: 90px;
}

/* Botón borrar pequeño */

.danger-button-small {
  background: #ff4d6d;

  width: auto;

  min-width: 80px;

  padding: 10px 14px;

  border-radius: 14px;

  font-size: 14px;
}

/* Nombre del integrante */

.balance-item span {
  flex: 1;
}

/* Mejor separación */

.balance-item strong {
  font-size: 16px;
}

/* Fecha pequeña */

.balance-item small {
  color: #777;
}
.main-logo {
  width: 260px;
  height: auto;
  display: block;
  margin-bottom: 10px;
}
.why-button {
  width: auto;
  margin-top: 8px;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 10px;
  background: #f0ecff;
  color: #5b2eff;
}
.payment-check {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.payment-check small {
  font-size: 11px;
  color: #777;
}
.profile-section {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.profile-image {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-info h3 {
  margin: 0;
  font-size: 18px;
}

.profile-info small {
  color: gray;
}

.user-photo {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
}

#userInfo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
}
.logged-user {
  position: absolute;

  top: 45px;
  right: 30px;

  display: flex;
  align-items: center;
  justify-content: center;

  width: auto;
  height: auto;

  background: transparent;
  padding: 0;
  margin: 0;

  border: none;
  box-shadow: none;

  z-index: 9999;
}
.top {
  position: relative;
}

.logged-user small {
  display: block;
  color: #777;
  font-size: 13px;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #5b2eff;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-button {
  width: auto;
  padding: 10px 14px;
  margin-left: auto;
  border-radius: 12px;
  font-size: 14px;
}
.profile-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #5b2eff;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: bold;
}

.profile-edit {
  margin-bottom: 25px;
}

.profile-edit input {
  margin-bottom: 12px;
}
.profile-section {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

#userInfo {
  margin-bottom: 18px;
}
.user-box {
  margin-bottom: 14px;
}
#editProfileButton {
  width: auto !important;
  padding: 10px 18px !important;
  border-radius: 14px;
  background: transparent !important;
  border: 2px solid #5b2eff;
  color: #5b2eff !important;
  font-weight: 600;
  font-size: 15px;
  margin-top: 18px;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
}

#editProfileButton:active {
  transform: scale(0.96);
}
body {
  background:
    radial-gradient(circle at top left, #f4eefe, transparent 35%),
    radial-gradient(circle at bottom right, #efe8ff, transparent 35%),
    #f7f7fb;
  min-height: 100vh;
  padding-bottom: 110px;
}

.card {
  background: rgba(255,255,255,0.58);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.45);
  box-shadow: 0 8px 30px rgba(91,46,255,0.08);
  border-radius: 28px;
  padding: 20px;
  margin-bottom: 18px;
  animation: fadeUp 0.25s ease;
}

.top {
  position: relative;
  text-align: left;
  margin-bottom: 24px;
}

.floating-user,
.logged-user {
  position: absolute !important;
  top: 42px;
  right: 22px;
  width: auto !important;
  height: auto !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  z-index: 9999;
}

.floating-user .user-avatar,
.logged-user .user-avatar {
  width: 42px;
  height: 42px;
  font-size: 15px;
  box-shadow: 0 8px 20px rgba(91,46,255,0.22);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: calc(100% - 110px);
  max-width: 340px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 4px;
  border-radius: 20px;
  background: rgba(255,255,255,0.38);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 8px 22px rgba(0,0,0,0.08);
  z-index: 99999;
}

.nav-item {
  width: 58px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1px;
  font-size: 11px;
  font-weight: 500;
  color: #777;
  background: transparent;
  transition: all 0.2s ease;
}

.nav-item span {
  margin-top: -2px;
  background: transparent;
}

.nav-item.active {
  background: rgba(91,46,255,0.10);
  color: #5b2eff;
}

input,
select {
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(255,255,255,0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 18px;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.6);
  transition: all 0.2s ease;
}

button:active {
  transform: scale(0.97);
}

button {
  transition:
    transform 0.12s ease,
    opacity 0.2s ease,
    box-shadow 0.2s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
#topUserAvatar {
  cursor: pointer;
}
#logoutProfileButton {
  margin-top: 12px;
  background: #ff4d6d;
}
.ios-toggle {
  width: 52px;
  height: 32px;
  background: #d1d1d6;
  border-radius: 999px;
  position: relative;
  transition: all 0.25s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.ios-toggle.active {
  background: #34c759;
}

.ios-toggle::after {
  content: "";
  width: 28px;
  height: 28px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.ios-toggle.active::after {
  left: 22px;
}
.profile-section {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  min-width: 72px;
  border-radius: 50%;
}

#editProfileButton {
  margin-top: 8px;
  margin-bottom: 10px;
}

.bottom-nav {
  position: fixed !important;
  left: 50% !important;
  bottom: 14px !important;
  transform: translateX(-50%) !important;

  width: calc(100% - 110px) !important;
  max-width: 340px !important;

  display: flex !important;
  flex-direction: row !important;
  justify-content: space-around !important;
  align-items: center !important;

  padding: 4px !important;
  border-radius: 20px !important;

  background: rgba(255,255,255,0.38) !important;
  backdrop-filter: blur(22px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(180%) !important;

  border: 1px solid rgba(255,255,255,0.35) !important;
  box-shadow: 0 8px 22px rgba(0,0,0,0.08) !important;

  z-index: 99999 !important;
}

.nav-item {
  width: 58px !important;
  height: 48px !important;

  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;

  gap: 1px !important;
  border-radius: 14px !important;

  font-size: 11px !important;
  color: #777 !important;
  background: transparent !important;
}

.nav-item span {
  margin-top: -2px !important;
  background: transparent !important;
}

.nav-item.active {
  background: rgba(91,46,255,0.10) !important;
  color: #5b2eff !important;
}
#logoutCircleButton {
  width: 56px !important;
  height: 56px !important;

  min-width: 56px !important;
  max-width: 56px !important;

  padding: 0 !important;
  margin: 0 !important;

  border-radius: 50% !important;

  background: rgba(255,255,255,0.85) !important;
  color: #666 !important;

  border: none !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  font-size: 34px !important;
  font-weight: 300 !important;
  line-height: 1 !important;

  box-shadow:
    0 8px 24px rgba(0,0,0,0.10) !important;

  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;

  cursor: pointer !important;

  flex-shrink: 0 !important;

  transition: all 0.2s ease !important;
}

.profile-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}
.app-section {
  position: relative;

  opacity: 0;
  transform: translateY(12px);

  pointer-events: none;

  height: 0;
  overflow: hidden;

  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}

.app-section.active-section {
  opacity: 1;
  transform: translateY(0);

  pointer-events: auto;

  height: auto;
  overflow: visible;
}
.app-section {
  display: none !important;
}

.app-section.active-section {
  display: block !important;
}
.global-loader {
  position: fixed;
  inset: 0;
  background: rgba(247, 247, 251, 0.78);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.global-loader.hide {
  opacity: 0;
  visibility: hidden;
}

.loader-card {
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 28px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 18px 45px rgba(91,46,255,0.12);
}

.loader-card img {
  width: 180px;
  margin-bottom: 18px;
}

.loader-spinner {
  width: 34px;
  height: 34px;
  border: 4px solid rgba(91,46,255,0.15);
  border-top: 4px solid #5b2eff;
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}

.loader-card p {
  margin: 0;
  color: #777;
  font-size: 14px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.activity-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-top: 14px;
  padding-top: 14px;

  border-top: 1px solid rgba(0,0,0,0.06);

  color: #777;
  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
}

#activityDropdown {
  display: none;
  margin-top: 12px;
}

#activityDropdown.show {
  display: block;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 10px 0;

  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.activity-dot {
  width: 28px;
  height: 28px;

  border-radius: 50%;

  background: rgba(91,46,255,0.16);
  color: #5b2eff;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 11px;
  font-weight: 700;

  flex-shrink: 0;
}

.activity-item strong {
  display: block;
  font-size: 13px;
  color: #151526;
}

.activity-item small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #888;
}

.activity-empty {
  margin: 12px 0 0;
  color: #888;
  font-size: 13px;
}
.saved-group-block {
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding-bottom: 12px;
}

.activityDropdown {
  display: none;
  margin-top: 8px;
}

.activityDropdown.show {
  display: block;
}
.activityDropdown:not(.show) {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  border: none !important;
}
.saved-group-block .balance-item {
  border-bottom: none !important;
}

.activity-toggle {
  border-top: 1px solid rgba(0,0,0,0.06);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 12px 0;
  margin-top: 4px;
}

.activityDropdown.show {
  display: block !important;
  margin-top: 10px;
  padding-bottom: 8px;
}
.auth-hidden {
  display: none !important;
}
#logoutCircleButton {
  display: none;
}

#logoutCircleButton.show {
  display: flex !important;
}
.google-button {
  background: white !important;
  color: #444 !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
}
.forgot-button {
  background: transparent !important;
  color: #777 !important;
  box-shadow: none !important;
  border: none !important;
  font-size: 14px !important;
  padding: 8px !important;
  margin-top: 8px !important;
}
.password-wrapper {
  position: relative;
  width: 100%;
}

.password-wrapper input {
  width: 100%;
  padding-right: 50px;
  box-sizing: border-box;
}

.password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 18px;
  user-select: none;
}
#logoutCircleButton {
  display: none !important;
}

#logoutCircleButton.show {
  display: flex !important;
}
.activity-item span {
  display: block;
  font-size: 13px;
  color: #555;
  margin-top: 2px;
}
.small-text {
  color: #777;
  font-size: 14px;
  margin-top: -6px;
  margin-bottom: 12px;
}

.identity-text {
  color: #5b2eff;
  font-weight: 700;
  margin-top: 12px;
}
.identity-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  display: none;
  align-items: center;
  justify-content: center;

  padding: 24px;
  z-index: 999999;
}

.identity-modal.show {
  display: flex;
}

.identity-modal-box {
  width: 100%;
  max-width: 360px;

  background: rgba(255,255,255,0.95);
  border-radius: 26px;
  padding: 24px;

  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}

.identity-modal-box h2 {
  margin-top: 0;
}

.identity-modal-box p {
  color: #777;
}

.identity-cancel-button {
  background: transparent !important;
  color: #777 !important;
  box-shadow: none !important;
}
.stats-header {
  margin-bottom: 16px;
}

.stats-header h2 {
  font-size: 28px;
  margin-bottom: 4px;
}

.stats-header p {
  color: #777;
  margin-top: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.stats-card {
  background: rgba(255,255,255,0.65);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(91,46,255,0.08);
  border: 1px solid rgba(255,255,255,0.45);
}

.stats-card.wide {
  margin-bottom: 18px;
}

.stats-card small {
  display: block;
  color: #555;
  margin-bottom: 8px;
}

.stats-card strong {
  display: block;
  font-size: 24px;
  color: #5b2eff;
}

.stats-card p {
  color: #777;
  font-size: 13px;
  margin-bottom: 0;
}

.stats-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 10px;
}

.my-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.stats-bar-row {
  margin-bottom: 16px;
}

.stats-bar-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.stats-bar-bg {
  height: 8px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
}

.stats-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #5b2eff, #9b7cff);
  border-radius: 999px;
}
.app-section {
  display: none !important;
}

.app-section.active-section {
  display: block !important;
}
.app-section {
  display: none !important;
}

.app-section.active-section {
  display: block !important;
}
.stats-selector-card {
  background: rgba(255,255,255,0.75);
  border-radius: 18px;
  padding: 12px 14px;
  margin: 14px 0 18px;
  box-shadow: 0 8px 24px rgba(91,46,255,0.08);
}

.stats-selector-card select {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  outline: none;
}

.stats-selector-card small {
  display: block;
  margin-top: 6px;
  color: #777;
}
.stats-icon {
  font-size: 22px !important;
  width: 38px;
  height: 38px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(91,46,255,0.08);
  margin-bottom: 12px;
}

#generalStatsCards.single-column {
  display: block !important;
}

#generalStatsCards.single-column .stats-card {
  width: 100%;
  box-sizing: border-box;
}

.general-summary-footer {
  margin: 18px 0;
  padding: 18px;
  border-radius: 22px;
  background: rgba(91,46,255,0.08);
}

.general-summary-footer h3 {
  margin-top: 0;
}

.general-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.general-summary-grid div {
  background: white;
  border-radius: 16px;
  padding: 14px;
}
.stats-card {
  position: relative;
  padding-top: 54px !important;
}

.stats-card {
  position: relative !important;
  padding: 18px !important;
}

.stats-icon {
  position: static !important;
  width: 34px !important;
  height: 34px !important;
  font-size: 18px !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  border-radius: 12px !important;
  background: rgba(91, 46, 255, 0.08) !important;

  margin: 0 0 14px 0 !important;
}
#generalStatsCards .stats-card.wide {
  padding: 18px !important;
}

#generalStatsCards .balance-item {
  display: grid !important;
  grid-template-columns: 1fr auto 18px !important;
  align-items: center !important;
  gap: 10px !important;

  padding: 12px 0 !important;
  border-bottom: 1px solid rgba(0,0,0,0.06) !important;
}

#generalStatsCards .balance-item strong {
  font-size: 16px !important;
  color: #151527 !important;
}

#generalStatsCards .balance-item span {
  font-size: 15px !important;
  font-weight: 700 !important;
  text-align: right !important;
}

#generalStatsCards .balance-item::after {
  content: "›";
  color: #bbb;
  font-size: 24px;
}
.stats-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.stats-title-row small {
  margin: 0;
  font-size: 14px;
}

.stats-icon {
  font-size: 16px !important;
  opacity: 0.4;
  background: none !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
}
#myStatsCard {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
}

.personal-summary-box {
  margin: 18px 0;
  padding: 18px;
  border-radius: 22px;
  background: rgba(91,46,255,0.08);
}

.personal-summary-box h3 {
  margin-top: 0;
  margin-bottom: 18px;
}
.red {
  color: #e94f6d !important;
}

.green {
  color: #55b66f !important;
}