/* Kelixa — navegación de transformación financiera */

.bottom-nav--v2 {
  grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-height) + 8px);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav--v2.bottom-nav--with-negocio {
  grid-template-columns: repeat(5, 1fr);
}

.bottom-nav--with-negocio .bottom-nav__fab {
  width: 54px;
  height: 54px;
  top: -20px;
}

.bottom-nav__label {
  display: block;
  font-size: 0.62rem;
  line-height: 1.15;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-nav__label--stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.05;
  white-space: normal;
  font-size: 0.56rem;
}

.bottom-nav__label--stack span {
  display: block;
}

.bottom-nav--with-negocio .bottom-nav__label {
  font-size: 0.6rem;
}

.bottom-nav__item--negocio.is-active {
  color: var(--purple-dark);
}

.bottom-nav__item--negocio .bottom-nav__icon {
  font-size: 1.05rem;
}

.bottom-nav__item--negocio {
  position: relative;
  z-index: 1;
}

.bottom-nav__item--fab-slot {
  position: relative;
  z-index: 6;
  pointer-events: auto;
  min-height: 44px;
}

.bottom-nav__fab {
  position: absolute;
  left: 50%;
  top: -22px;
  transform: translateX(-50%);
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  color: var(--white);
  box-shadow: 0 8px 24px rgba(91, 45, 139, 0.35);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  pointer-events: auto;
  z-index: 6;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bottom-nav__fab::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
}

.bottom-nav__fab:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 12px 28px rgba(91, 45, 139, 0.4);
}

.bottom-nav__fab-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.bottom-nav__fab-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.bottom-nav__item--keli .bottom-nav__icon {
  font-size: 1.2rem;
}

.bottom-nav__item span.bottom-nav__label {
  font-size: 0.62rem;
  line-height: 1.15;
  text-align: center;
}

/* Menú flotante Registrar — layout reorganizado */

.register-sheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.register-sheet.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.register-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 27, 53, 0.5);
}

.register-sheet__panel {
  position: relative;
  width: min(100%, var(--max-width));
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 40px rgba(91, 45, 139, 0.2);
  transform: translateY(100%);
  transition: transform 0.25s ease;
}

.register-sheet.is-open .register-sheet__panel {
  transform: translateY(0);
}

.register-sheet__header {
  flex-shrink: 0;
  padding: 18px 18px 8px;
  text-align: center;
  border-bottom: 1px solid rgba(91, 45, 139, 0.08);
}

.register-sheet__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--purple-dark);
}

.register-sheet__subtitle {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.register-sheet__body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 8px;
  display: grid;
  gap: 14px;
  -webkit-overflow-scrolling: touch;
}

.register-sheet__block {
  padding: 12px;
  border-radius: 16px;
  background: #faf8fd;
  border: 1px solid rgba(91, 45, 139, 0.08);
}

.register-sheet__block--negocio {
  background: linear-gradient(180deg, #f8f4ff 0%, #faf8fd 100%);
  border-color: rgba(91, 45, 139, 0.14);
}

.register-sheet__block-title {
  margin: 0 0 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--purple-dark);
}

.register-sheet__block-hint {
  margin: 12px 0 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.register-sheet__primary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.register-sheet__primary--four {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.register-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 72px;
  padding: 10px 6px;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid rgba(91, 45, 139, 0.1);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.register-chip:active {
  transform: scale(0.98);
}

.register-chip__icon {
  font-size: 1.45rem;
  line-height: 1;
}

.register-chip--income {
  border-color: rgba(39, 174, 96, 0.25);
  background: #f4fcf7;
}

.register-chip--expense {
  border-color: rgba(231, 76, 60, 0.2);
  background: #fff7f6;
}

.register-chip--savings {
  border-color: rgba(34, 211, 238, 0.25);
  background: #f0fcff;
}

.register-chip--negocio {
  background: var(--white);
}

.register-sheet__secondary {
  display: grid;
  gap: 6px;
}

.register-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--white);
  border: 1px solid rgba(91, 45, 139, 0.08);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

.register-row--negocio {
  margin-top: 8px;
}

.register-row__icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.register-row__text {
  flex: 1;
  min-width: 0;
}

.register-row__arrow {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.register-sheet__keli {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f3ebff, #eef8ff);
  border: 1px solid rgba(91, 45, 139, 0.15);
  color: var(--text);
  text-decoration: none;
}

.register-sheet__keli-icon {
  font-size: 1.6rem;
}

.register-sheet__keli strong {
  display: block;
  font-size: 0.9rem;
}

.register-sheet__keli small {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.register-sheet__close {
  flex-shrink: 0;
  display: block;
  width: calc(100% - 32px);
  margin: 8px 16px calc(12px + env(safe-area-inset-bottom, 0));
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
}

/* Legacy register-option (compat) */

.register-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 88px;
  padding: 14px 10px;
  border-radius: 18px;
  background: var(--bg);
  border: 1px solid rgba(91, 45, 139, 0.08);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  transition: transform 0.12s ease, background 0.12s ease;
}

.register-option:hover {
  transform: translateY(-1px);
  background: var(--purple-soft);
  color: var(--purple-dark);
}

.register-option__icon {
  font-size: 1.6rem;
}

.register-option--keli {
  width: 100%;
  flex-direction: row;
  min-height: 56px;
  background: linear-gradient(135deg, var(--purple-soft), #f3ebff);
  border-color: rgba(91, 45, 139, 0.15);
}

.register-option--wide {
  grid-column: 1 / -1;
  flex-direction: row;
  min-height: 56px;
  gap: 10px;
}

.register-sheet__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

/* Banner instalar PWA (móvil) */

.pwa-install {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + 12px);
  transform: translateX(-50%) translateY(120%);
  width: min(calc(100% - 24px), var(--max-width));
  z-index: 25;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.28s ease, opacity 0.28s ease, visibility 0.28s ease;
}

.pwa-install.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

.pwa-install__panel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 14px 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(91, 45, 139, 0.12);
  box-shadow: 0 12px 32px rgba(26, 31, 58, 0.18);
  backdrop-filter: blur(10px);
}

.pwa-install__icon {
  font-size: 1.6rem;
  line-height: 1;
}

.pwa-install__title {
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--purple-dark);
}

.pwa-install__text {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.pwa-install__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.pwa-install__close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

body:not(.has-app-nav) .pwa-install {
  bottom: 16px;
}

@media (min-width: 1024px) {
  .pwa-install {
    display: none;
  }
}

.push-status {
  margin: 10px 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.push-status--ok {
  color: #1e7b44;
}

.push-status--warn {
  color: #b7791f;
}

.push-status--info {
  color: #1f6f8b;
}

.push-status--error {
  color: var(--red);
}
