@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Roboto:wght@300;400;500;700&display=swap');

:root {
  /* --- Globales --- */
  --fondo: #FAFAFA;
  --texto: #111111;
  --card-bg: #ffffff;
  --gris: #6b7280;
  --borde: #ececec;
  --progress-track: #ececec;
  --nav-bg: #ffffff;

  /* --- Colores por módulo (Nv100) --- */
  --mod-horario: #4C39C7;
  --mod-horario-grad: linear-gradient(135deg, #7C6CF8 0%, #5B4FEA 100%);
  --mod-horario-soft: #F2F0FF;
  --mod-horario-shadow: rgba(108,92,231,.18);

  --mod-ahorro: #2251CC;
  --mod-ahorro-grad: linear-gradient(135deg, #5B8DF8 0%, #2251CC 100%);
  --mod-ahorro-soft: #EEF3FF;
  --mod-ahorro-shadow: rgba(34,81,204,.18);

  --mod-gastos: #D62839;
  --mod-gastos-grad: linear-gradient(135deg, #FF6B6B 0%, #D62839 100%);
  --mod-gastos-soft: #FFEFEF;
  --mod-gastos-shadow: rgba(214,40,57,.18);

  --mod-habitos: #1D9A5C;
  --mod-habitos-grad: linear-gradient(135deg, #4ED890 0%, #1D9A5C 100%);
  --mod-habitos-soft: #EAFBF2;
  --mod-habitos-shadow: rgba(29,154,92,.18);

  --mod-perfil: #D69E00;
  --mod-perfil-grad: linear-gradient(135deg, #FFD966 0%, #D69E00 100%);
  --mod-perfil-soft: #FFF9E6;
  --mod-perfil-shadow: rgba(214,158,0,.18);

  --mod-inicio: #8B5CF6;
  --mod-inicio-grad: linear-gradient(135deg, #B794F6 0%, #8B5CF6 100%);
  --mod-inicio-soft: #F3EEFF;
  --mod-inicio-shadow: rgba(139,92,246,.18);

  --mod-trabajo: #6F4E37;
  --mod-trabajo-grad: linear-gradient(135deg, #A9784F 0%, #6F4E37 100%);
  --mod-trabajo-soft: #F3ECE4;
  --mod-trabajo-shadow: rgba(111,78,55,.18);

  /* Módulo activo por default (se sobreescribe por página vía body.mod-*) */
  --mod-color: var(--mod-ahorro);
  --mod-grad: var(--mod-ahorro-grad);
  --mod-soft: var(--mod-ahorro-soft);
  --mod-shadow: var(--mod-ahorro-shadow);

  /* Alias retrocompatibles usados en todo el código existente */
  --naranja: var(--mod-color);
  --naranja-fuerte: var(--mod-color);
  --azul: var(--mod-ahorro);
  --azul-claro: var(--mod-ahorro);
  --morado: var(--mod-horario);
  --verde: var(--mod-habitos);
  --nav-active-bg: var(--mod-soft);

  /* --- Tipografía --- */
  --font-titulo: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-texto: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

  /* --- Espaciado (sistema de 8px) --- */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 40px;
  --sp-6: 48px;
  --sp-8: 64px;

  /* --- Radios --- */
  --radius-input: 16px;
  --radius-sm: 16px;
  --radius-md: 24px;
  --radius-lg: 24px;
  --radius-chart: 16px;
  --radius-full: 300px;

  /* --- Sombras (con tinte del módulo, nunca negras) --- */
  --shadow-sm: 0 2px 10px rgba(17,17,17,.06);
  --shadow-md: 0 8px 24px var(--mod-shadow);
  --shadow-lg: 0 16px 40px var(--mod-shadow);
}

html.dark-mode {
  --fondo: #14151a;
  --texto: #f3f3f5;
  --gris: #9a9ba3;
  --borde: #2a2b33;
  --card-bg: #1d1e25;
  --progress-track: #2a2b33;
  --nav-bg: #1d1e25;
  --shadow-sm: 0 2px 10px rgba(0,0,0,.35);
  --shadow-md: 0 8px 24px rgba(0,0,0,.4);
  --shadow-lg: 0 16px 40px rgba(0,0,0,.45);

  /* Los tonos "pálidos" de cada módulo son claros a propósito para modo
     claro — en modo oscuro se oscurecen para no quedar como un parche
     claro sin adaptar sobre el fondo oscuro. */
  --mod-horario-soft: #201f3a;
  --mod-ahorro-soft: #17233d;
  --mod-gastos-soft: #3a1f22;
  --mod-habitos-soft: #16302a;
  --mod-perfil-soft: #332a12;
  --mod-inicio-soft: #241f38;
  --mod-trabajo-soft: #2a2118;
}
html.dark-mode .char-row.saved { background: #17301c; border-color: #275a30; }
html.dark-mode .checkmark { background: var(--card-bg); border-color: #4a4f5a; }
html.dark-mode .avatar-bubble img,
html.dark-mode .speech-bubble::after { background: var(--card-bg); }
html.dark-mode .speech-bubble::after { border-color: transparent transparent var(--card-bg) transparent; }
html.dark-mode .login-body { filter: none; }

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--font-texto);
  font-size: 16px;
  line-height: 160%;
  background: var(--fondo);
  color: var(--texto);
  transition: background 0.2s ease, color 0.2s ease;
  touch-action: manipulation;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-titulo); margin: 0; color: var(--texto); }
h1 { font-size: 32px; font-weight: 700; line-height: 120%; }
h2 { font-size: 28px; font-weight: 700; line-height: 120%; }
h3 { font-size: 24px; font-weight: 700; line-height: 125%; }
h4 { font-size: 20px; font-weight: 600; line-height: 130%; }
h5 { font-size: 18px; font-weight: 600; line-height: 135%; }
h6 { font-size: 16px; font-weight: 600; line-height: 140%; }
.text-small { font-family: var(--font-texto); font-size: 14px; font-weight: 400; }
.text-label { font-family: var(--font-texto); font-size: 12px; font-weight: 300; }

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--sp-2) var(--sp-2) var(--sp-5);
}

.topbar {
  background: var(--mod-color);
  color: #fff;
  padding: 10px 16px 12px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.topbar .brand { font-weight: 700; font-size: 16px; }
.topbar-links { display: flex; align-items: baseline; gap: 10px; }
.topbar .logout-link, .topbar .back-link {
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  opacity: 0.85;
}
.topbar .version-link {
  color: #fff;
  text-decoration: none;
  font-size: 10.5px;
  opacity: 0.55;
}
.topbar .settings-link {
  text-decoration: none;
  font-size: 15px;
  opacity: 0.85;
  line-height: 1;
}

/* --- Barra de Ki --- */
.ki-gauge-track {
  background: rgba(255,255,255,0.28);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}
.ki-gauge-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #FFEA9C, #FFD966);
  box-shadow: 0 0 8px rgba(255,217,61,0.5);
  animation: ki-pulse 2.2s ease-in-out infinite;
  transition: width 0.4s ease;
}
@keyframes ki-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.25); }
}
.ki-gauge-label {
  margin-top: 5px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ki-icon { color: #ffd93d; }
.ki-goal { font-weight: 400; opacity: 0.75; }

/* --- Contenido con espacio para el nav inferior --- */
.has-bottom-nav { padding-bottom: 130px; }

/* --- Navegación inferior fija --- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--nav-bg);
  border-top: 1px solid var(--borde);
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 6px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  z-index: 20;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: var(--gris);
  padding: 8px 4px;
  border: 1px solid grey;
  border-radius: 12px;
  font-size: 10px;
  background: var(--card-bg);
}
.nav-item .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}
.nav-item .nav-icon svg { width: 100%; height: 100%; }
.nav-item.active {
  color: var(--mod-color);
  background: var(--mod-soft);
  border-color: var(--mod-color);
}

/* --- Login --- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #F3EEFF;
  position: relative;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
}
.login-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 0;
}
.login-brand-top {
  position: absolute;
  top: 24px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-weight: 800;
  font-size: 32px;
  line-height: 40px;
  letter-spacing: 0.02em;
  z-index: 2;
  margin: 0;
}
.login-version-bottom {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-weight: 300;
  font-size: 11px;
  opacity: 0.8;
  z-index: 2;
  margin: 0;
}
.login-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  position: relative;
  z-index: 1;
}
.login-emblem { font-size: 42px; margin-bottom: 8px; }
.login-card h1 { margin: 0 0 4px; font-size: 22px; color: var(--azul); }
.muted { color: var(--gris); font-size: 14px; }
.login-card form { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.login-card input[type="password"] {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--borde);
  font-size: 16px;
}
.error { color: #c0392b; font-size: 13px; margin: 8px 0 0; }

button, .btn-primary, .btn-secondary {
  cursor: pointer;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-texto);
  font-size: 16px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-align: center;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
button:active, .btn-primary:active, .btn-secondary:active { transform: scale(0.97); }

.login-card button, .btn-primary {
  width: 100%;
  height: 56px;
  background: var(--mod-grad);
  color: #fff;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}
.login-card button:active, .btn-primary:active { box-shadow: var(--shadow-sm); }

.btn-block {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  margin-top: 18px;
}

.btn-secondary {
  width: 100%;
  height: 56px;
  background: var(--card-bg);
  border: 1.5px solid var(--mod-color);
  color: var(--mod-color);
  margin-top: 14px;
  box-shadow: none;
}
.btn-secondary:active { background: var(--mod-soft); }

/* --- Progreso --- */
.progress-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 16px;
  border: 1px solid var(--borde);
}
.progress-card h2 { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--texto); }

.progress-numbers {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}
.progress-numbers > div { text-align: center; flex: 1; }
.progress-numbers .big {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--naranja-fuerte);
}
small { font-size: 12px; }
.habito-anio-grid {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 2px;
  margin-top: 10px;
}
.habito-anio-dia {
  aspect-ratio: 1;
  border-radius: 2px;
  min-width: 0;
}
.phrase-card-centrada #speechBubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.phrase-card-centrada .phrase-card-avatar { margin: 0 auto 10px; }
.phrase-card-centrada .phrase-character { order: 2; margin-top: 8px; }
.phrase-card-centrada .phrase-text { order: 1; }
.progress-numbers .small {
  display: block;
  font-size: 12px;
  color: var(--gris);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.progress-bar {
  background: var(--mod-soft);
  border-radius: var(--radius-full);
  height: 10px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--mod-grad);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Activación de color por módulo --- */
body.mod-horario { --mod-color: var(--mod-horario); --mod-grad: var(--mod-horario-grad); --mod-soft: var(--mod-horario-soft); --mod-shadow: var(--mod-horario-shadow); }
body.mod-ahorro  { --mod-color: var(--mod-ahorro);  --mod-grad: var(--mod-ahorro-grad);  --mod-soft: var(--mod-ahorro-soft);  --mod-shadow: var(--mod-ahorro-shadow); }
body.mod-gastos  { --mod-color: var(--mod-gastos);  --mod-grad: var(--mod-gastos-grad);  --mod-soft: var(--mod-gastos-soft);  --mod-shadow: var(--mod-gastos-shadow); }
body.mod-habitos { --mod-color: var(--mod-habitos); --mod-grad: var(--mod-habitos-grad); --mod-soft: var(--mod-habitos-soft); --mod-shadow: var(--mod-habitos-shadow); }
body.mod-perfil  { --mod-color: var(--mod-perfil);  --mod-grad: var(--mod-perfil-grad);  --mod-soft: var(--mod-perfil-soft);  --mod-shadow: var(--mod-perfil-shadow); }
body.mod-inicio  { --mod-color: var(--mod-inicio);  --mod-grad: var(--mod-inicio-grad);  --mod-soft: var(--mod-inicio-soft);  --mod-shadow: var(--mod-inicio-shadow); }
body.mod-trabajo { --mod-color: var(--mod-trabajo); --mod-grad: var(--mod-trabajo-grad); --mod-soft: var(--mod-trabajo-soft); --mod-shadow: var(--mod-trabajo-shadow); }

/* --- Enlace de módulo: mayúsculas, semibold, subrayado, color del módulo --- */
.link-mod {
  display: inline-block;
  text-transform: none;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: normal;
  text-decoration: none;
  color: var(--mod-color);
}

/* --- Tarjeta hero con degradado (la caja más importante de cada pantalla) --- */
.hero-card {
  background: var(--mod-grad);
  color: #fff;
  border-radius: 12px;
  padding: var(--sp-3);
  text-align: center;
  box-shadow: var(--shadow-md);
}
.hero-card * { color: #fff; }
.hero-card h2 { font-size: 21px; font-weight: 700; text-align: center; }
.hero-card .progress-numbers .big { font-size: 21px; font-weight: 700; color: #FFD966; }
.hero-card .progress-numbers .small { font-size: 11px; text-transform: capitalize; color: #FFD966; }
.hero-card .progress-bar {
  background: rgba(255,255,255,0.28);
  border: none;
  height: 10px;
  margin-top: var(--sp-2);
}
.hero-card .progress-bar-fill { background: linear-gradient(90deg, #FFEA9C, #FFD966); }

/* --- Divisor sutil entre elementos de una lista --- */
.lista-divisor > * + * { border-top: 1px solid var(--borde); }
.lista-divisor > * { padding: 7px 0; }
.lista-divisor > *:first-child { padding-top: 2px; }

/* --- Tarjeta de mensaje de personaje (spec global Nv100) --- */
.char-msg-card {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  background: var(--mod-grad);
  border-radius: var(--radius-lg);
  padding: var(--sp-2);
  box-shadow: var(--shadow-md);
}
.char-msg-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid #FFD966;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.char-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.char-msg-body { flex: 1; text-align: left; }
.char-msg-text { color: #fff; font-size: 14px; line-height: 145%; margin: 0; }
.char-msg-name { color: #fff; font-weight: 800; font-size: 14px; letter-spacing: 0.2px; }
.progress-percent {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--gris);
  text-align: center;
}

/* --- Frase --- */
.phrase-card {
  background: var(--mod-grad);
  color: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
  text-align: left;
  box-shadow: none;
  border: none;
}
#speechBubble {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.phrase-card-avatar { margin: 0; flex-shrink: 0; }
.phrase-character {
  font-size: 14px;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.phrase-text {
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
  min-height: 0;
  color: #fff;
}
#btnOtraFrase:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Lista --- */
.list-hint { margin-top: 14px; }
.char-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.char-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  border-radius: 10px;
  padding: 10px 12px;
  transition: background 0.2s ease;
}
.char-row.saved {
  background: #eaf7ec;
  border-color: #bfe3c4;
}

.char-check { position: relative; display: inline-block; width: 24px; height: 24px; flex-shrink: 0; }
.char-check input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; cursor: pointer; }
.checkmark {
  position: absolute;
  top: 0; left: 0;
  width: 24px; height: 24px;
  border-radius: 6px;
  border: 2px solid #c9c0ad;
  background: #fff;
  pointer-events: none;
}
.char-check input:checked + .checkmark {
  background: var(--verde);
  border-color: var(--verde);
}
.char-check input:checked + .checkmark::after {
  content: "";
  position: absolute;
  left: 7px; top: 3px;
  width: 6px; height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.char-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.char-num { font-size: 11px; color: var(--gris); }
.char-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.char-date { font-size: 11px; color: var(--verde); }
.char-amount { font-size: 13px; color: var(--naranja-fuerte); font-weight: 700; white-space: nowrap; }

/* --- Links auxiliares --- */
.back-link-inline {
  display: inline-block;
  margin-top: 12px;
  color: var(--mod-color);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.btn-block-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  margin-top: 12px;
}

/* --- Gráfica --- */
.chart-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 16px;
  border: 1px solid var(--borde);
}
.chart-card h2 { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--texto); }

/* --- Frase / consejo a pantalla completa --- */
.frase-fullscreen { display: flex; flex-direction: column; align-items: center; }
.frase-stage {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
  align-items: center;
  margin-top: 16px;
  background: var(--mod-grad);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  box-shadow: var(--shadow-md);
  text-align: left;
}
.avatar-bubble {
  width: 76px;
  height: 76px;
  max-width: 76px;
  max-height: 76px;
  border-radius: 50%;
  border: 3px solid #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.15);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  flex-shrink: 0;
  grid-row: 1 / 3;
}
.avatar-bubble img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}
.avatar-bubble.small {
  width: 72px;
  height: 72px;
  max-width: 72px;
  max-height: 72px;
  border-width: 3px;
}
.avatar-placeholder { font-size: 32px; }
.avatar-placeholder.small { font-size: 28px; }

.coach-badge { grid-column: 2; grid-row: 1; margin: 0 0 4px; }

.speech-bubble {
  grid-column: 2;
  grid-row: 2;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  max-width: 100%;
  text-align: left;
}
.speech-bubble::before, .speech-bubble::after { display: none; }
.speech-bubble.consejo-bubble { border: none; }

.speech-name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  opacity: 0.85;
  font-weight: 700;
  margin: 6px 0 0;
}
.speech-text { font-size: 14px; line-height: 1.4; margin: 0; color: #fff; order: -1; }

.speech-bubble.pop { animation: pop-in 0.25s ease; }
@keyframes pop-in {
  0% { transform: scale(0.9); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

.phrase-label { font-size: 11px; color: #fff; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 8px; }
.phrase-card-avatar { margin: 0 auto 10px; border-color: #fff; }
.btn-centrado { width: fit-content; margin-left: auto; margin-right: auto; }

/* --- Grid de desbloqueados --- */
.char-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--texto);
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  border-radius: 12px;
  padding: 10px 6px;
}
.grid-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(160deg, var(--naranja), var(--azul-claro));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.grid-avatar img { width: 100%; height: 100%; object-fit: cover; }
.grid-num { font-size: 10px; color: var(--gris); }
.grid-name {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Estado vacío --- */
.empty-state {
  text-align: center;
  margin-top: 40px;
  color: var(--gris);
}
.empty-state .avatar-placeholder { font-size: 48px; display: block; margin-bottom: 10px; }
.empty-state .btn-primary { margin-top: 18px; }

/* --- Toast --- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translate(-50%, 20px);
  background: var(--azul);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  max-width: 90%;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 50;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --- Ajustes --- */
.settings-section {
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  padding: 6px 16px;
  margin-top: 16px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--borde);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-text { display: flex; flex-direction: column; }
.settings-row-title { font-size: 14.5px; font-weight: 600; }
.settings-row-desc { font-size: 12px; color: var(--gris); margin-top: 2px; }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--progress-track);
  border-radius: 999px;
  transition: 0.2s;
}
.switch-slider::before {
  content: "";
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.switch input:checked + .switch-slider { background: var(--naranja); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

.settings-status { font-size: 12px; color: var(--gris); margin-top: 4px; }
.settings-group-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gris);
  margin: 20px 4px 6px;
}

/* --- Changelog --- */
.changelog-list { margin-top: 16px; list-style: none; padding: 0; }
.changelog-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--borde);
}
.changelog-item:last-child { border-bottom: none; }
.changelog-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--naranja);
  margin-top: 5px;
  flex-shrink: 0;
}
.changelog-date {
  font-size: 11.5px;
  color: var(--gris);
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}
.changelog-desc { font-size: 14px; line-height: 1.4; margin-top: 2px; }

/* --- Pago / contador --- */
.countdown-card {
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  padding: 26px 18px;
  margin-top: 18px;
  text-align: center;
}
.countdown-number {
  font-size: 52px;
  font-weight: 800;
  color: var(--naranja-fuerte);
  line-height: 1;
}
.countdown-label {
  font-size: 13px;
  color: var(--gris);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 6px;
}
.countdown-date {
  font-size: 14px;
  margin-top: 10px;
  color: var(--texto);
}

/* --- Controles de la lista (orden / modo misterio) --- */
.list-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.list-toggle-btn {
  flex: 1 1 30%;
  text-align: center;
  text-decoration: none;
  color: var(--mod-color);
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  border-radius: 999px;
  padding: 10px 8px;
  font-size: 14px;
  font-weight: 600;
}
.hidden-count {
  text-align: center;
  margin-top: 10px;
  font-size: 12.5px;
}

/* --- Tarjeta "misterio" en la lista --- */
.char-row.mystery {
  background: repeating-linear-gradient(135deg, var(--card-bg), var(--card-bg) 10px, var(--progress-track) 10px, var(--progress-track) 20px);
  border-style: dashed;
}
.char-row.mystery .char-num,
.char-row.mystery .mystery-name {
  color: var(--gris);
}
.char-row.mystery .mystery-name { letter-spacing: 0.15em; font-weight: 700; }
.char-row.mystery .checkmark { border-color: var(--naranja); }

/* --- Modal de frase triste --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 24px;
}
.modal-card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 24px 20px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--texto);
}
.modal-card .speech-text, .modal-card p, .modal-card span { color: var(--texto); }
.modal-card .speech-text { margin: 10px 0 18px; }

/* --- Racha de quincenas --- */
.racha-badge {
  margin: 10px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--naranja-fuerte);
  background: var(--nav-active-bg);
  border-radius: 999px;
  padding: 6px 10px;
  display: block;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* --- Tarjeta de Uranai Baba --- */
.baba-card {
  background: linear-gradient(135deg, #3a1f5c, #5b2a86);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
  color: #fff;
}
.baba-row { display: flex; align-items: center; gap: 12px; }
.baba-name {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #d9b8ff;
  font-weight: 700;
  margin: 0 0 4px;
}
.baba-frase { font-size: 13.5px; line-height: 1.4; margin: 0; }
.baba-text { flex: 1; }

/* --- Historial de transacciones --- */
.historial-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.historial-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  border-radius: 10px;
  padding: 10px 12px;
}
.historial-fecha {
  width: 42px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--mod-color);
  line-height: 1.1;
  flex-shrink: 0;
}
.historial-fecha span {
  display: block;
  font-size: 9.5px;
  text-transform: uppercase;
  color: var(--gris);
  font-weight: 400;
}
.historial-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.historial-num { font-size: 11px; color: var(--gris); }
.historial-nombre { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.historial-monto { font-size: 13px; font-weight: 700; color: var(--mod-color); white-space: nowrap; }

/* --- Banner de meta completada --- */
.torneo-banner {
  display: block;
  text-align: center;
  text-decoration: none;
  background: linear-gradient(90deg, #ffd93d, var(--naranja));
  color: #3a2400;
  font-weight: 800;
  padding: 14px;
  border-radius: 12px;
  margin-top: 14px;
  font-size: 14px;
  animation: ki-pulse 2.2s ease-in-out infinite;
}

/* --- Modal de insignia / cápsula del tiempo --- */
.insignia-monto {
  font-size: 12px;
  color: var(--gris);
  margin: -6px 0 4px;
}
.capsula-form { width: 100%; margin: 10px 0 4px; text-align: left; }
.capsula-label { font-size: 12px; color: var(--gris); margin: 0 0 6px; }
.capsula-textarea {
  width: 100%;
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 10px;
  font-family: inherit;
  font-size: 13.5px;
  resize: vertical;
  background: var(--fondo);
  color: var(--texto);
}

/* --- Pantalla del Torneo de Artes Marciales --- */
.torneo-card {
  background: linear-gradient(160deg, #1f4e78, #3a1f5c);
  color: #fff;
  border-radius: 16px;
  padding: 26px 20px;
  margin-top: 14px;
  text-align: center;
}
.torneo-anuncio { font-size: 18px; font-weight: 800; margin: 14px 0 6px; line-height: 1.3; }
.torneo-sub { font-size: 13.5px; opacity: 0.9; margin: 0; }
.torneo-ciclos { font-size: 12.5px; margin-top: 10px; color: #ffd93d; }

.capsulas-section { margin-top: 20px; }
.capsulas-section h2, .reinicio-section h2 { font-size: 16px; color: var(--azul); margin: 0 0 4px; }
.capsula-card {
  background: var(--card-bg);
  border: 1px dashed var(--borde);
  border-radius: 12px;
  padding: 14px;
  margin-top: 10px;
}
.capsula-monto { font-size: 11px; color: var(--gris); margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.03em; }
.capsula-texto { font-size: 14px; line-height: 1.5; margin: 0; }

.reinicio-section { margin-top: 26px; padding-bottom: 10px; }

.torneo-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}
.torneo-confetti span {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 14px;
  opacity: 0.85;
  animation: confetti-fall 3.2s linear infinite;
}
.torneo-confetti span:nth-child(1) { left: 5%; background: #ff8c1a; animation-delay: 0s; }
.torneo-confetti span:nth-child(2) { left: 15%; background: #2e75b6; animation-delay: 0.3s; }
.torneo-confetti span:nth-child(3) { left: 25%; background: #ffd93d; animation-delay: 0.6s; }
.torneo-confetti span:nth-child(4) { left: 35%; background: #2e7d32; animation-delay: 0.1s; }
.torneo-confetti span:nth-child(5) { left: 45%; background: #e26a00; animation-delay: 0.9s; }
.torneo-confetti span:nth-child(6) { left: 55%; background: #8e44ad; animation-delay: 0.4s; }
.torneo-confetti span:nth-child(7) { left: 65%; background: #ff8c1a; animation-delay: 1.2s; }
.torneo-confetti span:nth-child(8) { left: 75%; background: #2e75b6; animation-delay: 0.7s; }
.torneo-confetti span:nth-child(9) { left: 85%; background: #ffd93d; animation-delay: 1.5s; }
.torneo-confetti span:nth-child(10) { left: 95%; background: #2e7d32; animation-delay: 0.2s; }
.torneo-confetti span:nth-child(11) { left: 50%; background: #e26a00; animation-delay: 1.8s; }
.torneo-confetti span:nth-child(12) { left: 10%; background: #8e44ad; animation-delay: 2.1s; }
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.9; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0.4; }
}

/* --- Topbar: hamburguesa --- */
.topbar-left { display: flex; align-items: center; gap: 10px; }
.home-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  text-decoration: none;
  flex-shrink: 0;
}
.hamburger-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* --- Drawer lateral de Ahorro --- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

.ahorro-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 82%;
  max-width: 300px;
  background: var(--card-bg);
  z-index: 90;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 20px rgba(0,0,0,0.2);
}
.ahorro-drawer.open { transform: translateX(0); }

.drawer-header {
  background: var(--mod-grad);
  color: #fff;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 15px;
}
.drawer-close-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 8px;
  overflow-y: auto;
}
.drawer-nav a, .drawer-nav .drawer-disabled {
  display: block;
  padding: 13px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--texto);
  font-size: 14px;
}
.drawer-nav a:active { background: var(--nav-active-bg); }
.drawer-nav a.active { background: var(--mod-soft); color: var(--mod-color); font-weight: 700; }
.drawer-nav .drawer-disabled { color: var(--gris); opacity: 0.6; }

/* --- Nav inferior: módulo deshabilitado --- */
.nav-item.disabled { opacity: 0.4; }

/* --- Teasers en Inicio (reemplazan las tarjetas de Baba/Villano) --- */
.teaser-row { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.teaser-link {
  display: block;
  text-decoration: none;
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mod-color);
}

/* --- Tarjetas grandes en pantallas dedicadas (Baba / Villano) --- */
.baba-card-big, .villano-card-big { padding: 20px; }
.baba-card-big .baba-row, .villano-card-big .villano-row { align-items: center; }
.villano-desconocido { border-color: #555; }
.villano-desconocido .villano-titulo { color: #888; }

.proximamente-card {
  background: var(--card-bg);
  border: 1px dashed var(--borde);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
}
.proximamente-titulo { font-weight: 700; font-size: 13.5px; margin: 0 0 6px; color: var(--azul); }

/* --- Calculadora de Uranai Baba --- */
.baba-calc-card {
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
}
.baba-calc-titulo { font-weight: 700; font-size: 14px; margin: 0 0 4px; color: #8e44ad; }
.baba-resultado {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3a1f5c, #5b2a86);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.4;
}
.baba-resultado-grid {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.baba-resultado-grid > div {
  flex: 1;
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.baba-resultado-num { display: block; font-size: 18px; font-weight: 800; color: #ffd93d; }
.baba-resultado-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.03em; opacity: 0.85; }

/* --- Botón de pánico (chat) --- */
.panico-chat {
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  border-radius: 16px;
  margin-top: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.panico-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--azul);
  color: #fff;
}
.panico-nombre { font-weight: 700; font-size: 14px; }
.panico-mensajes {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
  max-height: 50vh;
  overflow-y: auto;
}
.panico-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  line-height: 1.4;
}
.panico-bubble-personaje {
  align-self: flex-start;
  background: var(--nav-active-bg);
  color: var(--texto);
  border-bottom-left-radius: 4px;
}
.panico-bubble-usuario {
  align-self: flex-end;
  background: var(--azul);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.panico-cierre { font-weight: 600; }
.panico-contador {
  align-self: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #2e7d32;
  margin: 4px 0 0;
}
.panico-opciones {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px 16px;
}
.panico-opcion-btn {
  background: var(--card-bg);
  border: 1.5px solid var(--mod-color);
  color: var(--mod-color);
  border-radius: 999px;
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
}
.panico-opcion-btn:active { background: var(--nav-active-bg); }

/* --- Hábitos --- */
.habito-card {
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 12px;
}
.habito-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.habito-nombre { font-size: 14.5px; font-weight: 700; }
.habito-contadores { display: flex; gap: 8px; font-size: 11.5px; font-weight: 700; }
.chip-verde { color: #2e7d32; }
.chip-rojo { color: #c0392b; }

.habito-dias-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.habito-dia {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1.5px solid var(--borde);
  background: var(--fondo);
  color: var(--texto);
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
}
.habito-dia.hoy { border-color: var(--naranja); border-width: 2px; }
.habito-dia.hoy.sinmarcar { background: #FFD966; border-color: #e0a800; color: #7a5c00; }
.habito-dia.verde { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.habito-dia.rojo { background: #c0392b; border-color: #c0392b; color: #fff; }
.habito-dia.sinmarcar { background: var(--fondo); border-color: var(--borde); color: var(--gris); }
.habito-dia.futuro { opacity: 0.35; }
.chip-racha { color: var(--texto); }
.chip-calendario { text-decoration: none; font-size: 13px; }
#habitosLista.habitos-bloqueados .habito-dia {
  opacity: 0.5;
  pointer-events: none;
  filter: grayscale(40%);
}

/* --- Perfil --- */
.perfil-header {
  text-align: center;
  margin-top: 16px;
}
.perfil-foto {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--naranja), var(--azul-claro));
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
.perfil-foto img { width: 100%; height: 100%; object-fit: cover; }
.perfil-nombre { font-size: 18px; font-weight: 800; margin: 0; color: var(--azul); }

.puntos-card {
  background: linear-gradient(135deg, #2b2b2b 0%, #0a0a0a 100%);
  border-radius: 16px;
  padding: 20px;
  margin-top: 14px;
  text-align: center;
  color: #fff;
}
.puntos-num { display: block; font-size: 32px; font-weight: 800; color: #FFD966; }
.puntos-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.85; color: #fff; }

.medallas-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.medalla-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--nav-active-bg);
  border-radius: 12px;
  padding: 10px 4px;
  text-align: center;
}
.medalla-icono { font-size: 26px; }
.medalla-nombre { font-size: 9.5px; font-weight: 700; line-height: 1.2; }

.medallas-reticula {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.medalla-card-v2 {
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  border-radius: 14px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}
.medalla-card-v2.bloqueada { opacity: 0.5; }
.medalla-card-v2 summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.medalla-card-v2 summary::-webkit-details-marker { display: none; }
.medalla-icono-v2 { font-size: 28px; }
.medalla-nombre-v2 { font-size: 10.5px; font-weight: 700; line-height: 1.2; }
.medalla-detalle { margin-top: 10px; font-size: 11px; color: var(--gris); text-align: left; }
.medalla-detalle p { margin: 3px 0; }

.medallas-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.medalla-item-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--mod-soft);
  border-radius: 14px;
  padding: 14px 8px;
  text-decoration: none;
  color: var(--mod-color);
  text-align: center;
}
.medalla-item-grid.bloqueada { background: var(--nav-active-bg); color: var(--gris); opacity: 0.6; }
.medalla-icono-grid { font-size: 30px; }
.medalla-nombre-grid { font-size: 10px; font-weight: 700; line-height: 1.2; }

/* --- Cabecera nueva de Perfil --- */
.perfil-header-nuevo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--mod-soft);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 14px;
}
.perfil-foto-cuarto {
  width: 25%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.perfil-foto-cuarto img { width: 100%; height: 100%; object-fit: cover; }
.perfil-header-info { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.perfil-status-badge { display: inline-block; font-size: 10.5px; font-weight: 700; color: #2e7d32; margin-top: 6px; }

.reticula-perfil {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.reticula-perfil .inicio-card-chica { width: 100%; }

/* --- Premios --- */
.premios-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.premio-card {
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 90px;
}
.premio-card.bloqueado { opacity: 0.55; }
.premio-nombre { font-size: 12px; line-height: 1.35; }
.premio-costo-btn {
  align-self: flex-start;
  background: linear-gradient(90deg, #e0a800, #ffd93d);
  color: #3a2400;
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
}
.premio-costo-btn:disabled { background: var(--progress-track); color: var(--gris); }

/* --- Premios: modo misterio --- */
.misterio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.misterio-card {
  background: linear-gradient(160deg, #5b2a86, #8e44ad);
  border-radius: var(--radius-md);
  padding: 16px 8px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  transition: transform 0.1s ease;
}
.misterio-card:active { transform: scale(0.97); }
.misterio-card.revelado {
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  cursor: default;
}
.misterio-oculto {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.misterio-signo { font-size: 34px; }
.misterio-costo { font-size: 12px; font-weight: 700; color: #ffd93d; }
.misterio-revelado {
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.misterio-nombre { font-size: 12.5px; font-weight: 700; line-height: 1.3; }

/* --- Cristal del Día --- */
.cristal-dia-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #16a085, #2ecc71);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 12px;
  color: #fff;
}
.cristal-dia-icono { font-size: 30px; }
.cristal-dia-titulo { font-size: 13.5px; font-weight: 800; margin: 0; }
.cristal-dia-desc { font-size: 11px; margin: 2px 0 0; opacity: 0.9; }

.capsula-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #16a085, #2ecc71);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 12px;
  color: #fff;
  cursor: pointer;
}
.capsula-icono { font-size: 30px; }
.capsula-titulo { font-size: 13.5px; font-weight: 800; margin: 0; }
.capsula-desc { font-size: 11px; margin: 2px 0 0; opacity: 0.9; }

.mision-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1.5px solid #B794F6;
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 10px;
}
.mision-card.completada { opacity: 0.6; }
.mision-check { border: none; background: none; font-size: 24px; flex-shrink: 0; padding: 0; color: #B794F6; }
.mision-titulo { font-size: 14px; font-weight: 800; color: #B794F6; margin: 0; text-transform: none; letter-spacing: 0.03em; }
.mision-texto { font-size: 14px; margin: 3px 0 0; color: var(--texto); }
.mision-card.completada .mision-texto { text-decoration: line-through; }

/* --- Bienestar --- */
.animo-selector {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.animo-opcion {
  flex: 0 0 18%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--nav-active-bg);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 10px 4px;
  font-family: inherit;
}
.animo-opcion.seleccionado { border-color: var(--naranja); background: var(--card-bg); }

/* --- Línea de vida --- */
.linea-vida-track {
  position: relative;
  margin-top: 14px;
  padding-left: 20px;
  border-left: 3px solid var(--borde);
}
.linea-vida-item {
  position: relative;
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.linea-vida-icono {
  position: absolute;
  left: -32px;
  top: 0;
  font-size: 20px;
  background: var(--fondo);
  width: 28px;
  text-align: center;
}
.linea-vida-fecha { font-size: 10.5px; color: var(--gris); margin: 0; }
.linea-vida-titulo { font-size: 14px; font-weight: 700; margin: 2px 0; }
.linea-vida-desc { font-size: 12.5px; color: var(--texto); margin: 2px 0 6px; }

/* --- Inicio (dashboard global) --- */
.inicio-saludo { text-align: center; margin: 16px 0 4px; }
.inicio-saludo-titulo {
  font-size: 23px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--texto);
}
.inicio-saludo-fecha { font-size: 13px; color: var(--gris); margin: 4px 0 0; text-transform: capitalize; }

.notif-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--borde); }
.notif-item:last-of-type { border-bottom: none; }
.notif-icono { font-size: 20px; flex-shrink: 0; }
.notif-foto { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--mod-color); }
.notif-titulo { font-size: 13px; font-weight: 700; margin: 0; }
.notif-texto { font-size: 12px; color: var(--gris); margin: 2px 0 0; }
.notif-puntos { font-size: 10.5px; color: var(--mod-color); font-weight: 700; margin: 4px 0 0; }
.notif-clicable { cursor: pointer; border-radius: 8px; }
.notif-clicable:not(.leida) { background: var(--mod-soft); padding: 8px; margin: 2px 0; }
.notif-clicable.leida { opacity: 0.55; }
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #c0392b;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  min-width: 15px;
  height: 15px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.inicio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.inicio-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  border-radius: var(--radius-lg);
  padding: 16px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--borde);
  background: color-mix(in srgb, var(--card-mod, var(--mod-color)) 10%, white);
  color: var(--card-mod, var(--mod-color));
  transition: transform 0.1s ease;
}
.inicio-card:active { transform: scale(0.97); }
.inicio-card-icono { font-size: 24px; }
.inicio-card-label { font-size: 11.5px; opacity: 0.9; font-weight: 600; color: inherit; }
.inicio-card-valor { font-size: 20px; font-weight: 800; color: inherit; }

.objetivo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.objetivo-check {
  border: none;
  background: none;
  font-size: 20px;
  flex-shrink: 0;
  padding: 0;
}
.objetivo-texto { font-size: 13.5px; }
.objetivo-texto.completado { text-decoration: line-through; opacity: 0.6; }

.objetivos-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.objetivo-row-grid {
  background: var(--card-bg);
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 10px;
}

/* --- Widget principal de Inicio (full width) --- */
.inicio-widget-principal {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 14px;
  text-decoration: none;
  color: #fff;
  box-shadow: var(--shadow-md);
}
.iwp-icono { font-size: 26px; }
.iwp-label { font-size: 14px; opacity: 0.9; font-weight: 600; margin-top: 4px; }
.iwp-valor { font-size: 19px; font-weight: 800; }

/* --- Grid de 3 columnas (hábitos en Inicio) --- */
.inicio-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.inicio-card-chica { padding: 10px 6px; text-align: center; align-items: center; }
.inicio-card-chica .inicio-card-label { font-size: 10px; line-height: 1.2; }

/* --- Abonos a tarjetas de crédito --- */
.abono-tarjeta-card {
  background: var(--nav-active-bg);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 10px;
}
.abono-tarjeta-titulo { font-size: 12.5px; font-weight: 700; margin: 0 0 6px; }
.abono-tarjeta-linea { font-size: 11.5px; margin: 4px 0; }

.tarjeta-estatus-manual {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--borde);
}
.tarjeta-estatus-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12.5px;
}

/* --- Hábitos medibles --- */
.medible-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 10px;
}
.medible-info { display: flex; flex-direction: column; gap: 3px; }
.medible-nombre { font-size: 13.5px; font-weight: 700; }
.medible-valor { font-size: 12px; color: var(--gris); }
.medible-botones { display: flex; gap: 8px; }
.medible-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: #1D9A5C;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
}
.medible-restar { background: var(--gris); }
.medible-tiempo { font-size: 11px; color: #1D9A5C; font-weight: 600; }
.medible-botones-tiempo { margin-top: 6px; width: 100%; display: flex; justify-content: flex-end; }
.medible-btn-tiempo {
  border: 1px solid var(--borde);
  background: var(--card-bg);
  color: #1D9A5C;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  margin-left: 6px;
}
.medible-config-toggle {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--borde);
  background: var(--card-bg);
  color: var(--gris);
  font-size: 13px;
  margin-left: 4px;
}

.perfil-emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.perfil-color-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.perfil-color-opcion {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  padding: 0;
}
.perfil-color-opcion.seleccionado { border-color: var(--texto); box-shadow: 0 0 0 2px var(--card-bg) inset; }
.perfil-emoji-opcion {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  border: 2px solid var(--borde);
  background: var(--fondo);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.perfil-emoji-opcion.seleccionado { border-color: var(--mod-color); background: var(--mod-soft); }

.tabla-registro { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tabla-registro th { text-align: left; color: var(--gris); font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--borde); }
.tabla-registro td { padding: 6px 4px; border-bottom: 1px solid var(--borde); }
.tabla-registro th:last-child, .tabla-registro td:last-child { text-align: right; }
.tabla-registro tfoot td { font-weight: 700; border-top: 2px solid var(--mod-color); border-bottom: none; color: var(--mod-color); }

/* --- Análisis General de Hábitos --- */
.analisis-card {
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 10px;
}
.analisis-card.analisis-flojo {
  border-color: #c0392b;
  background: #fdecea;
}
html.dark-mode .analisis-card.analisis-flojo { background: #3a1414; }
.analisis-sugerencia { font-size: 12px; color: #c0392b; margin: 8px 0 0; line-height: 1.4; }
.analisis-card-acordeon summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.analisis-card-acordeon summary::-webkit-details-marker { display: none; }
.analisis-card-acordeon[open] summary { margin-bottom: 4px; }

/* --- Horario --- */
.plantilla-fila {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--borde);
}
.plantilla-hora { font-size: 11.5px; color: var(--gris); width: 78px; flex-shrink: 0; }

.horario-card-v2 {
  display: grid;
  grid-template-columns: 33.33% 33.33% 33.33%;
  align-items: center;
  gap: 6px;
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  border-radius: 6px;
  padding: 10px 8px;
  margin-top: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.horario-card-v2.completado {
  background: color-mix(in srgb, var(--card-color, var(--mod-color)) 16%, white);
  border-color: transparent;
}
.horario-card-v2-nombre {
  font-size: 12.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.horario-card-v2.completado .horario-card-v2-nombre { text-decoration: line-through; opacity: 0.75; }
.hrow-hora {
  font-size: 8.5px;
  font-weight: 700;
  line-height: 12px;
  color: var(--gris);
  background: var(--nav-active-bg, var(--fondo));
  padding: 3px 6px;
  border-radius: 999px;
  text-align: center;
  white-space: nowrap;
  justify-self: center;
}
.hrow-categoria {
  font-size: 8.5px;
  font-weight: 700;
  line-height: 12px;
  color: #fff;
  padding: 3px 7px;
  border-radius: 999px;
  white-space: nowrap;
  justify-self: center;
}
.horario-check-v2 {
  display: none;
}
.horario-tag-fallido {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  background: #c0392b;
  color: #fff;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 4px;
  vertical-align: middle;
}
.horario-tag-extra {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  background: #e0a800;
  color: #fff;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.horario-tag-categoria {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 4px;
}
.horario-check-v2 {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--borde);
  background: var(--card-bg);
  color: transparent;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.horario-check-v2.checked {
  background: var(--mod-color);
  border-color: var(--mod-color);
  color: #fff;
}

/* --- Tabla resumen semanal de Horario --- */
.horario-tabla-wrap {
  overflow-x: auto;
  margin-top: 14px;
  background: var(--card-bg);
  border: 1px solid var(--borde);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.horario-tabla-semana { border-collapse: collapse; width: 100%; font-size: 12px; }
.horario-tabla-semana th, .horario-tabla-semana td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid var(--borde);
  white-space: nowrap;
}
.horario-tabla-semana th { font-size: 11px; color: var(--gris); font-weight: 700; }
.horario-tabla-semana th.es-hoy { color: var(--mod-color); }
.horario-tabla-nombre { text-align: left !important; font-weight: 600; font-size: 12px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }

/* --- Cuadrícula visual semanal (tipo calendario) --- */
.horario-grid-wrap {
  overflow-x: auto;
  margin-top: 14px;
  background: var(--card-bg);
  border: 1px solid var(--borde);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 8px;
}
.horario-grid {
  display: grid;
  gap: 3px;
  min-width: 860px;
}
.horario-grid-hora {
  font-size: 11px;
  font-weight: 600;
  color: var(--gris);
  text-align: right;
  padding: 4px 6px 0 0;
  white-space: nowrap;
}
.horario-grid-diahead {
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  padding: 6px 2px;
  color: var(--gris);
  opacity: 0.5;
}
.horario-grid-diahead.es-hoy { color: var(--mod-color); opacity: 1; }
.horario-grid-atenuado { opacity: 0.5; }
.horario-grid-celda { min-height: 42px; border-radius: 6px; background: var(--card-bg); border: 1px solid var(--borde); }
.horario-grid-bloque {
  cursor: pointer;
  padding: 3px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  border: 1px solid var(--borde);
}
.horario-grid-bloque:not(.completado) { background: var(--card-bg); }
.horario-grid-bloque span {
  font-size: 14px;
  font-weight: 700;
  color: var(--texto);
  line-height: 1.2;
}
.horario-grid-bloque .horario-grid-bullet {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
  flex-shrink: 0;
}
.horario-grid-bloque.completado {
  border-color: transparent;
}
.horario-grid-bloque.completado span { color: #fff; }
.horario-grid-bloque.completado .horario-grid-bullet { background: #fff !important; }

/* --- Reto del día / divisores / ojo --- */
.horario-reto-card {
  background: var(--mod-grad);
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
}
.horario-reto-card.completado { opacity: 0.65; text-decoration: line-through; }
.horario-divisor {
  text-align: center;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--gris);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 18px 0 4px;
  border-bottom: 1px dashed var(--borde);
  padding-bottom: 4px;
}
.btn-ojo {
  border: 1px solid var(--borde);
  background: var(--card-bg);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  font-size: 16px;
}
.ocultar-completados .horario-card-v2.completado { display: none; }
.ocultar-marcados-hoy .habito-card.tiene-estado-hoy { display: none; }

/* --- Botón del Sueño --- */
.dormir-card {
  background: linear-gradient(160deg, #1f4e78, #5b2a86);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-top: 16px;
  color: #fff;
}
.dormir-pregunta { font-size: 15px; font-weight: 700; text-align: center; margin: 0 0 16px; line-height: 1.4; }
.dormir-card .animo-selector .animo-opcion {
  background: rgba(255,255,255,0.12);
  border: 2px solid transparent;
}
.dormir-card .animo-opcion.seleccionado { border-color: #fff; background: rgba(255,255,255,0.25); }
.dormir-card textarea.gastos-input {
  background: rgba(255,255,255,0.95);
  border: none;
  color: #222;
  width: calc(100% + 40px);
  margin-left: -20px;
  box-sizing: border-box;
}
.dormir-siguiente { margin-top: 14px; }

/* --- Etiquetas de personalidad del personaje --- */
.personaje-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}
.personaje-tag {
  font-size: 11px;
  font-weight: 700;
  background: var(--nav-active-bg);
  color: var(--naranja-fuerte);
  padding: 5px 10px;
  border-radius: 999px;
}
.coach-badge {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #e0a800;
  background: #fff8e6;
  padding: 5px 12px;
  border-radius: 999px;
  margin: 8px auto 0;
  width: fit-content;
}
.grid-item.es-coach {
  border: 2px solid #e0a800 !important;
  box-shadow: 0 0 0 2px #fff8e6;
}
body.focus-mode .personaje-tag {
  background: rgba(255,255,255,0.85);
  color: #5b2a86;
}

/* --- Grid clickeable dentro de Frases --- */
.grid-section-title { font-size: 12.5px; color: var(--gris); text-align: center; margin: 22px 0 4px; }
.grid-item-btn {
  border: 1px solid var(--borde);
  cursor: pointer;
  font-family: inherit;
}

/* --- Widget de Ki en login --- */
.login-ki-widget {
  background: var(--azul);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 14px 0;
  text-align: left;
}
.login-ki-widget .ki-gauge-track { background: rgba(255,255,255,0.18); }
.login-ki-label { color: #fff; font-size: 13px; font-weight: 700; margin: 0 0 2px; }
.login-ki-sub { color: #d9e6f2; font-size: 11.5px; margin: 0; }
.login-avatar { margin: 0 auto 10px; }
.login-frase {
  font-size: 14px;
  font-style: italic;
  color: var(--azul);
  margin: 4px 0 2px;
  line-height: 1.4;
}
.login-frase-autor {
  font-size: 11.5px;
  color: var(--gris);
  margin: 0 0 6px;
}

/* --- Formularios de Gastos --- */
.gastos-form { display: flex; flex-direction: column; gap: 4px; }
.gastos-label { font-size: 12px; color: var(--gris); margin-top: 10px; }
.gastos-input {
  width: 100% !important;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--borde);
  font-size: 16px;
  font-family: inherit;
  background: var(--fondo);
  color: var(--texto);
  margin-bottom: 4px;
}
input, select, textarea { font-size: 16px; touch-action: manipulation; }
.gastos-form .btn-primary { margin-top: 16px; }

.cat-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 4px;
}
.etiqueta-editar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px 4px;
}
.gastos-input-sm {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--borde);
  font-size: 13.5px;
  font-family: inherit;
  background: var(--fondo);
  color: var(--texto);
  flex: 1;
  min-width: 0;
}
.gastos-input-num { flex: 0 0 90px; }
.btn-icon-sm {
  border: none;
  background: var(--nav-active-bg);
  color: var(--texto) !important;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.btn-link-danger {
  border: none;
  background: none;
  color: #c0392b;
  font-size: 12.5px;
  padding: 4px 14px 10px;
  text-decoration: underline;
}

/* --- Lista de categorías con barra de progreso (panel de Gastos) --- */
.cat-list { display: flex; flex-direction: column; margin-top: 10px; }
.cat-row-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.cat-nombre { font-size: 12px; font-weight: 600; }
.cat-monto { font-size: 12px; font-weight: 600; color: var(--gris); }

/* --- Servicios (tarjetas expandibles o clickeables) --- */
.servicio-card {
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.servicio-card summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.servicio-card summary::-webkit-details-marker { display: none; }
.servicio-nombre { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.servicio-sub { font-size: 12px; color: var(--gris); margin: 0; }
.servicio-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}
.servicio-tag.fijo { background: #e3f2e6; color: #2e7d32; }

.horario-card-actividad {
  background: var(--card-bg);
  border: 1px solid var(--mod-soft);
  box-shadow: none;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0;
}
.reticula-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.reticula-2col > *:has(details[open]) { grid-column: 1 / -1; }
.reticula-2col .horario-card-actividad form { text-align: left; }
.horario-card-actividad summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; }
.horario-card-actividad summary::-webkit-details-marker { display: none; }
.horario-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.servicio-tag.variable { background: #fdecea; color: #c0392b; }

.servicios-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.servicio-card-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  text-decoration: none;
  color: inherit;
}
.servicio-card-grid .servicio-nombre { justify-content: center; }
.servicio-card-grid .servicio-badge { margin-top: 4px; }

/* Cuando servicio-card es un <a> clickeable (Servicios, Deudas) */
.servicio-card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.servicio-card-link:active { transform: scale(0.98); }
.servicio-card-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}
.servicio-card-body p, .servicio-card-body div { margin: 0; }
.servicio-card-chevron {
  font-size: 22px;
  color: var(--gris);
  flex-shrink: 0;
  line-height: 1;
}

/* Chip de estado dentro de la tarjeta de servicio/deuda */
.estado-chip {
  display: inline-block;
  width: fit-content;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.estado-chip.pagado { background: #e3f2e6; color: #2e7d32; }
.estado-chip.vencido { background: #fdecea; color: #c0392b; }
.estado-chip.por-vencer { background: var(--nav-active-bg); color: var(--naranja-fuerte); }

.servicio-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  margin-top: 4px;
}
.servicio-badge-cuenta { background: var(--mod-soft); color: var(--mod-color); }
.servicio-badge-ok { background: #e3f2e6; color: #2e7d32; }
.servicio-badge-vencido { background: #fdecea; color: #c0392b; }

.caja-fuerte-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.caja-fuerte-item { margin-top: 0; text-align: center; }
.caja-fuerte-item summary { align-items: center; }
.caja-fuerte-item .servicio-nombre { justify-content: center; }
.caja-fuerte-item:has(details[open]) { grid-column: 1 / -1; }
.caja-fuerte-item form { text-align: left; }

/* --- Lista del Súper --- */
.super-lista { margin-top: 10px; }
.super-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
}
.super-item.comprado .super-nombre { text-decoration: line-through; opacity: 0.55; }
.super-check { border: none; background: none; font-size: 19px; padding: 0; flex-shrink: 0; }
.super-nombre { flex: 1; font-size: 13.5px; min-width: 0; }
.super-precio-form { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.super-simbolo { font-size: 12px; color: var(--gris); }
.super-precio-input {
  width: 56px;
  border: 1px solid var(--borde);
  border-radius: 8px;
  padding: 5px 6px;
  font-size: 12.5px;
  font-family: inherit;
  background: var(--fondo);
  color: var(--texto);
  text-align: right;
}

/* --- Botón flotante (FAB) --- */
.fab-add {
  position: fixed;
  right: 18px;
  bottom: calc(90px + env(safe-area-inset-bottom));
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--mod-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: 25;
}
.fab-add:active { transform: scale(0.94); }

.pagar-pedido-block summary {
  list-style: none;
  cursor: pointer;
  height: 60px !important;
  font-size: 17px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px var(--mod-shadow, rgba(0,0,0,0.2));
}
.pagar-pedido-block summary::-webkit-details-marker { display: none; }

/* --- Próximo servicio a pagar (resumen de Gastos) --- */
.proximo-pago-banner {
  display: block;
  background: var(--card-bg);
  border: 1px solid #e67e22;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
  font-size: 13px;
}
.proximo-pago-banner strong { color: #e67e22; }

/* --- Filtro del historial de gastos --- */
.filtro-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.filtro-row-full .filtro-chip { flex: 1; text-align: center; }

.horario-calendario-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 14px;
  box-sizing: border-box;
}
.horario-calendario-dia {
  aspect-ratio: 1;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  text-decoration: none;
  color: var(--texto);
  font-size: 10.5px;
  font-weight: 600;
  background: var(--card-bg);
  border: 1px solid var(--borde);
  min-width: 0;
}
.horario-calendario-dia small { font-size: 12px; font-weight: 400; color: var(--gris); }
.horario-calendario-dia.bien { background: #e3f2e6; border-color: #2e7d32; color: #2e7d32; }
.horario-calendario-dia.regular { background: #FFF8E1; border-color: #e0a800; color: #a97c00; }
.horario-calendario-dia.mal { background: #fdecea; border-color: #c0392b; color: #c0392b; }
.horario-calendario-dia.es-hoy { box-shadow: 0 0 0 2px var(--mod-color); }
.filtro-chip {
  flex-shrink: 0;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  border: none;
  color: var(--mod-color);
  background: var(--mod-soft);
}
.filtro-chip.active { background: var(--mod-grad); color: #fff; border-color: transparent; }

/* --- Selector de mes (Categorías) --- */
.mes-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 14px;
  margin-bottom: 14px;
}
.mes-nav {
  text-decoration: none;
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mod-color);
  font-size: 16px;
}
.mes-actual-label { font-size: 14px; font-weight: 700; min-width: 160px; text-align: center; }
.mes-actual-badge {
  color: var(--mod-color);
  background: var(--mod-soft);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
}
.mes-nav-disabled { opacity: 0.3; pointer-events: none; }
.mes-contenido-opaco { opacity: 0.55; }
.categoria-mes-actual { border: 2px solid var(--naranja); }

/* --- Categorías de presupuesto (nivel superior) --- */
.categoria-presupuesto-card {
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 16px;
}
.cat-editar-acordeon summary {
  list-style: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--mod-color);
  font-weight: 700;
  margin-top: 8px;
}
.cat-editar-acordeon summary::-webkit-details-marker { display: none; }
.cat-presupuesto-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 10px;
  margin-bottom: 6px;
  border-bottom: 2px solid var(--progress-track);
}
.cat-presupuesto-nombre { font-size: 15px; font-weight: 700; color: var(--texto); }
.cat-presupuesto-monto { font-size: 12.5px; color: var(--gris); }

.subcategoria-row {
  border-top: 1px solid var(--borde);
  padding: 10px 2px;
}
.subcategoria-row summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.subcategoria-row summary::-webkit-details-marker { display: none; }
.sub-nombre { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.sub-monto { font-size: 12px; color: var(--gris); white-space: nowrap; }
.subcategoria-nueva summary { color: var(--mod-color); font-weight: 600; font-size: 12px; }

.gastos-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-top: 10px;
  color: var(--texto);
}

/* --- Apartado de Crédito --- */
.tarjeta-credito-card {
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
}
.tarjeta-credito-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 12px;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--progress-track);
}
.tarjeta-credito-nombre { font-size: 16px; font-weight: 700; color: var(--texto); display: flex; align-items: center; gap: 8px; }
.tarjeta-mini-foto {
  width: 44px;
  height: 28px;
  object-fit: cover;
  border-radius: 5px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

/* --- Etiquetas --- */
.etiqueta-row {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--card-bg);
  border: 1px solid var(--borde);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 0.08s ease;
}
.etiqueta-row-fila1 { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.etiqueta-row-nota { font-size: 14px; opacity: 0.75; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.etiqueta-row:active { transform: scale(0.98); }
.etiqueta-row .cat-nombre { font-size: 14px; }
.etiqueta-row .cat-monto { text-align: right; white-space: nowrap; }

.etiqueta-eliminar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px;
  border-bottom: 1px solid var(--borde);
}
.etiqueta-eliminar-row:last-child { border-bottom: none; }
.etiqueta-eliminar-nombre { font-size: 13.5px; }
.etiqueta-eliminar-row .btn-link-danger { padding: 4px 0; }

/* --- Servicios/deudas como tarjeta clickeable --- */
.servicio-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* --- Mini-recibo --- */
.recibo-card {
  background: var(--card-bg);
  border: 1px solid var(--borde);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 14px;
  text-align: center;
}
.recibo-titulo { font-size: 16px; font-weight: 700; color: var(--texto); margin: 0 0 4px; }
.recibo-monto { font-size: 30px; font-weight: 800; color: var(--mod-color); margin: 0 0 4px; }
.recibo-estado {
  margin-top: 14px;
  padding: 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}
.recibo-estado.pagado { background: #e3f2e6; color: #2e7d32; }
.recibo-estado.vencido { background: #fdecea; color: #c0392b; }
.recibo-estado.por-pagar { background: #FFF8E1; color: var(--mod-color); }
.tarjeta-credito-total { font-size: 12.5px; color: var(--gris); }

.tarjeta-credito-dias { display: flex; gap: 10px; }
.dias-chip {
  flex: 1;
  background: #FFF8E1;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.dias-chip-pago { background: #fdecea; }
.dias-num { display: block; font-size: 22px; font-weight: 800; color: var(--mod-color); }
.dias-chip-pago .dias-num { color: #c0392b; }
.dias-label { font-size: 10.5px; color: var(--gris); line-height: 1.3; }

.tarjeta-credito-montos {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--texto);
}

/* --- Puntos de vida --- */
.gastos-top-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
}
.puntos-vida-badge {
  font-size: 13px;
  font-weight: 700;
  background: #fdecea;
  color: #c0392b;
  padding: 5px 10px;
  border-radius: 999px;
}

/* --- Aviso de próximo pago con niveles de urgencia --- */
.proximo-pago-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid #e67e22;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
  font-size: 13px;
}
.proximo-pago-icono { font-size: 20px; flex-shrink: 0; }
.proximo-pago-banner.pronto { border-color: #e67e22; background: #fff6ec; }
.proximo-pago-banner.urgente {
  border-color: #c0392b;
  background: #fdecea;
  animation: ki-pulse 1.6s ease-in-out infinite;
}
html.dark-mode .proximo-pago-banner.pronto { background: #3a2a12; }
html.dark-mode .proximo-pago-banner.urgente { background: #3a1414; }

/* --- Alerta de presupuesto rebasado --- */
.presupuesto-alerta {
  text-align: center;
  color: #c0392b;
  font-size: 12.5px;
  font-weight: 700;
  margin: 8px 0 0;
}

/* --- Servicios: títulos de sección y badge de pagado --- */
.seccion-titulo {
  font-size: 14px;
  font-weight: 600;
  color: var(--texto);
  margin: 22px 4px 8px;
}
.pagado-badge {
  text-align: center;
  color: #2e7d32;
  font-size: 12.5px;
  font-weight: 700;
  margin: 8px 0 0;
  background: #e3f2e6;
  border-radius: 8px;
  padding: 8px;
}

/* --- Villano del mes --- */
.villano-card {
  background: var(--card-bg);
  border: 1px solid #EAF1FE;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}
.villano-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.villano-text { flex: 1; }
.villano-titulo {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #c0392b;
  font-weight: 700;
  margin: 0 0 4px;
}
.villano-frase { font-size: 13.5px; line-height: 1.4; margin: 0; }
.villano-progress-track {
  background: var(--progress-track);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}
.villano-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #c0392b, #e74c3c);
}
.villano-progress-label { font-size: 12px; color: var(--gris); text-align: center; margin: 6px 0 0; }

/* --- Modo sin distracciones --- */
body.focus-mode .topbar,
body.focus-mode .bottom-nav {
  display: none !important;
}
body.focus-mode .has-bottom-nav { padding-bottom: 20px; padding-top: 20px; }

body.focus-mode #gridSection,
body.focus-mode #btnRecargar,
body.focus-mode #btnFocusMode {
  display: none !important;
}
body.focus-mode .frase-fullscreen {
  min-height: 100vh;
  width: calc(100% + 32px);
  margin: -16px -16px -40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--focus-gradient, var(--mod-grad));
  padding: 30px 16px;
}
body.focus-mode .frase-stage {
  background: transparent;
  box-shadow: none;
  padding: 0;
  width: 100%;
  max-width: 380px;
}
body.focus-mode .speech-bubble {
  background: transparent;
  border: none;
  box-shadow: none;
}
body.focus-mode .speech-name,
body.focus-mode .speech-text {
  color: #fff !important;
}
body.focus-mode .speech-bubble::before,
body.focus-mode .speech-bubble::after { display: none; }

.focus-exit-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 70;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-family: inherit;
}

.pago-dias-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  height: 76px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--mod-grad);
  color: #fff;
  font-size: 32px;
  font-weight: 800;
  font-family: var(--font-titulo);
}

/* --- Modo Sueño --- */
.dormir-blur {
  filter: blur(6px);
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
}
.dormir-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,0.25);
}
.dormir-overlay-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  max-width: 340px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.anio-acordeon-titulo {
  list-style: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  color: var(--mod-color);
  padding: 8px 0;
  border-bottom: 2px solid var(--mod-color);
}
.anio-acordeon-titulo::-webkit-details-marker { display: none; }
.mes-acordeon { margin-top: 10px; margin-left: 4px; }
.mes-acordeon-titulo {
  list-style: none;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--texto);
  background: var(--mod-soft);
  padding: 8px 12px;
  border-radius: 8px;
}
.mes-acordeon-titulo::-webkit-details-marker { display: none; }
.entrada-reciente { border: 2px solid var(--mod-color); }

.score-gauge-widget {
  display: block;
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--borde);
  border-radius: var(--radius-lg);
  padding: 18px 16px 14px;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
}
.score-gauge-etiqueta { font-size: 15px; font-weight: 800; margin: 4px 0 0; }
.score-gauge-sub { font-size: 11.5px; color: var(--gris); margin: 2px 0 0; }

.etiqueta-nota-acordeon {
  padding: 10px 0;
  border-bottom: 1px solid var(--borde);
}
.etiqueta-nota-acordeon:last-child { border-bottom: none; }
.etiqueta-nota-acordeon summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.etiqueta-nota-acordeon summary::-webkit-details-marker { display: none; }
.etiqueta-nota-fila1 { display: flex; justify-content: space-between; align-items: baseline; width: 100%; }
.etiqueta-nota-indicador { font-size: 14px; opacity: 0.75; margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.gastos-input.etiqueta-nota-textarea {
  width: 100% !important;
  display: block;
  box-sizing: border-box;
}

/* =========================================================
   INICIO — rediseño específico de esta pantalla
   ========================================================= */
body.mod-inicio, body.mod-inicio * {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
}
/* Tamaño mínimo de fuente: 14px, sin excepción, en toda esta pantalla */
body.mod-inicio .char-msg-name,
body.mod-inicio .capsula-label,
body.mod-inicio .capsula-monto,
body.mod-inicio .capsula-titulo,
body.mod-inicio .capsula-desc,
body.mod-inicio .mision-titulo,
body.mod-inicio .mision-texto,
body.mod-inicio .inicio-saludo-fecha,
body.mod-inicio .inicio-card-label,
body.mod-inicio .inicio-card-chica .inicio-card-label,
body.mod-inicio .score-gauge-sub,
body.mod-inicio small,
body.mod-inicio .small,
body.mod-inicio .muted {
  font-size: 14px !important;
}

/* Topbar fija siempre */
body.mod-inicio .topbar { position: fixed; top: 0; left: 0; right: 0; }
body.mod-inicio main.container { padding-top: 150px; }

/* Retícula, bloques y tarjetas: sin borde, sin sombra, 12px de radio */
body.mod-inicio .inicio-card,
body.mod-inicio .char-msg-card,
body.mod-inicio .capsula-card,
body.mod-inicio .score-gauge-widget,
body.mod-inicio .inicio-widget-principal {
  border-radius: 12px !important;
  border: none !important;
  box-shadow: none !important;
}

/* Cosas por hacer hoy y Misión de hoy: borde morado pálido en vez de sin borde */
body.mod-inicio .mision-card,
body.mod-inicio .chart-card {
  border-radius: 12px !important;
  border: 1px solid #f3eeff !important;
  box-shadow: none !important;
}
body.mod-inicio .objetivo-check { color: #B794F6; }
body.mod-inicio .objetivo-texto { color: var(--texto); font-size: 14px; }
body.mod-inicio .objetivo-row-grid { border-color: transparent !important; }
body.mod-inicio .mision-titulo { color: #000 !important; }

/* Botones: sin box-shadow en esta pantalla */
body.mod-inicio .btn-primary,
body.mod-inicio .btn-secondary,
body.mod-inicio button {
  box-shadow: none !important;
}

/* La barra inferior también con íconos Lucide y DM Sans (aplica a toda la app, ya que es un componente compartido) */
.bottom-nav, .bottom-nav * {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Menú inferior de Inicio: fondo degradado propio, elementos transparentes en blanco */
body.mod-inicio .bottom-nav {
  background: var(--mod-inicio-grad);
  border-top: none;
}
body.mod-inicio .nav-item {
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #fff;
}
body.mod-inicio .nav-item .nav-label { color: #fff; font-size: 14px; }
body.mod-inicio .nav-item.active {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
}

/* =========================================================
   LOGIN — DM Sans, mínimo 14px, tarjeta de personaje sin sombra/borde
   ========================================================= */
body.login-body, body.login-body * {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
}
body.login-body .muted,
body.login-body .error,
body.login-body .char-msg-name {
  font-size: 14px !important;
}
body.login-body .char-msg-card {
  border-radius: 12px !important;
  border: none !important;
  box-shadow: none !important;
}

/* =========================================================
   REGLAS GENERALES DE TODA LA APP
   ========================================================= */

/* Tipografía DM Sans en toda la app, mínimo 14px */
body, button, input, select, textarea {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Topbar fija en todas las pantallas */
.topbar { position: fixed !important; top: 0; left: 0; right: 0; z-index: 30; }
main.container { padding-top: 120px; }

/* Títulos siempre en color de texto normal (negro/blanco según modo), nunca en el color del módulo */
h1, h2, h3, h4, h5, h6 { color: var(--texto) !important; }
.hero-card h1, .hero-card h2, .hero-card h3, .hero-card h4 { color: #fff !important; }

/* Enlaces de texto: 14px, color del módulo de la página actual */
a.link-mod, .link-mod {
  font-size: 14px !important;
  color: var(--mod-color);
}

/* Bloques y tarjetas comunes: sin sombra, borde de 1px con el tono pálido del módulo, 12px de radio */
.chart-card, .servicio-card, .settings-section, .categoria-presupuesto-card, .cat-list, .capsula-card {
  border-radius: 12px !important;
  box-shadow: none !important;
  border: 1px solid var(--mod-soft) !important;
}

/* Botones: sin box-shadow en toda la app */
.btn-primary, .btn-secondary, button { box-shadow: none !important; }

/* Menú inferior fijo: degradado de la página actual, en TODAS las pantallas */
.bottom-nav {
  background: var(--mod-grad) !important;
  border-top: none !important;
}
.nav-item {
  background: transparent !important;
  border: none !important;
  border-radius: 6px !important;
  color: #fff !important;
}
.nav-item .nav-label { color: #fff !important; font-size: 14px !important; }
.nav-item.active {
  background: rgba(255,255,255,0.15) !important;
  color: var(--mod-soft) !important;
}
.nav-item.active .nav-label { color: var(--mod-soft) !important; }
.horario-calendario-dia.dia-de-pago-resaltado { background: #FFF8E1; border-color: #e0a800; color: #a97c00; }
