/* Dos disposiciones con el mismo HTML: móvil (pestañas abajo) y, desde 1024 px, barra lateral de 248 px. */
@media (max-width: 1023px) { .d-only { display: none !important; } }
@media (min-width: 1024px) { .m-only { display: none !important; } }

/* ---------- Móvil ---------- */
body { min-height: 100vh; }
.side { display: none; }
#views { padding-bottom: calc(100px + env(safe-area-inset-bottom)); min-width: 0; }
.view[hidden] { display: none; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 7;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.tab { display: grid; justify-items: center; gap: 3px; padding-top: 7px; min-height: 52px; font-size: 11px; color: var(--muted); text-decoration: none; border-radius: 12px; font-weight: 500; }
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="true"] { color: var(--ink); font-weight: 700; background: var(--surface-2); }

.view__head {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  display: flex; flex-direction: column; gap: 10px;
}
.view__row { display: flex; align-items: center; gap: 10px; }
.view__title { flex: 1; min-width: 0; }
.view__row--center .view__title { text-align: center; }
.view__title h1 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.view__sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.view__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.view__body { padding: 12px 16px 0; display: flex; flex-direction: column; gap: 12px; }
.progress { margin-top: 2px; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }
.progress__label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 5px; }

.g3, .g2, .g4 { display: grid; gap: 12px; align-items: start; min-width: 0; }
.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* Botón del asistente: siempre abajo a la derecha */
.fab {
  position: fixed; right: 16px; bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 6;
  width: 56px; height: 56px; border-radius: 50%; border: 0; padding: 0;
  background: var(--dark); color: var(--on-dark); display: grid; place-items: center;
  box-shadow: 0 10px 24px rgb(0 0 0 / .25);
}
.fab svg { width: 24px; height: 24px; color: var(--accent); }
.fab span { display: none; }

/* ---------- Escritorio ---------- */
@media (min-width: 1024px) {
  body { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
  .tabbar { display: none; }
  #views { padding-bottom: 0; }

  .side {
    display: flex; flex-direction: column; gap: 18px;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: 22px 16px; border-right: 1px solid var(--line);
  }
  .view__head {
    position: static; background: transparent; backdrop-filter: none; border: 0;
    padding: 26px 32px 0; flex-direction: row; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px;
  }
  .view__row--center .view__title { text-align: left; }
  .view__title h1 { font-size: 30px; }
  .view__body { padding: 20px 32px 32px; gap: 20px; }
  .g3, .g2, .g4 { gap: 20px; }
  .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g2 { grid-template-columns: minmax(0, 1fr) 300px; }
  .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .col { gap: 20px; }

  .fab {
    right: 24px; bottom: 24px; width: auto; height: 52px; border-radius: 999px; padding: 0 18px 0 14px;
    display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600;
    box-shadow: var(--shadow);
  }
  .fab svg { width: 20px; height: 20px; }
  .fab span { display: inline; }
}

/* Barra lateral */
.side__logo { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.side__mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.side__mark svg { width: 18px; height: 18px; }
.side__name { font-weight: 700; font-size: 16px; letter-spacing: .02em; }
.side__sub { font-size: 12px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .08); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav hr { border: 0; border-top: 1px solid var(--line); margin: 8px 10px; }
.side__capture { width: 100%; height: 40px; }
.side__spacer { flex: 1; }
.side__card { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.side__card[hidden] { display: none; }
.side__big { display: flex; align-items: baseline; gap: 6px; }
.side__big b { font-size: 22px; font-weight: 700; }
.side__user { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.side__user-name { font-size: 13px; font-weight: 600; flex: 1; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--dark); color: var(--on-dark); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.side__gear { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); border: 0; background: transparent; padding: 0; }
.side__gear svg { width: 18px; height: 18px; }

/* Entrada con clave (pantalla completa; en escritorio con panel oscuro a la derecha) */
.login { position: fixed; inset: 0; z-index: 20; background: var(--bg); display: grid; grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
.login[hidden] { display: none; }
.login__main { display: grid; place-items: center; padding: 32px 24px; }
.login__form { width: min(400px, 100%); display: flex; flex-direction: column; gap: 18px; }
.login__brand { display: flex; align-items: center; gap: 12px; }
.login__brand .side__mark { width: 44px; height: 44px; border-radius: 12px; }
.login__brand .side__mark svg { width: 24px; height: 24px; }
.login__brand .side__name { font-size: 20px; }
.login__form h1 { font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
.login__hint { margin-top: 6px; color: var(--muted); font-size: 14px; }
.login__form .field input { height: 46px; font-size: 16px; border-radius: 12px; }
.login__form .btn { height: 44px; font-size: 14px; border-radius: 12px; }
.login__foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.login__error { color: var(--danger); font-size: 14px; min-height: 1.2em; }
.login__aside { display: none; }
@media (min-width: 1024px) {
  .login { grid-template-columns: minmax(0, 1fr) 560px; }
  .login__aside { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; background: #15171c; color: #fff; padding: 48px 56px; }
  .login__aside-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
  .login__aside-top b { font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #b9ea00; }
  .login__aside-top span { color: #9aa1ad; }
  .login__quote { font-size: 30px; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; }
  .login__by { margin-top: 18px; color: #9aa1ad; font-size: 14px; }
}

/* "Más" (móvil) y Ajustes */
.list-card { padding: 0; overflow: hidden; }
.it { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px; border-top: 1px solid var(--line-2); text-decoration: none; color: var(--ink); width: 100%; background: transparent; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; }
.it:first-child { border-top: 0; }
.it__ic { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); }
.it__ic svg { width: 20px; height: 20px; }
.it__ic--negocio { background: var(--now-bg); color: var(--now-ink); }
.it__ic--salud { background: var(--done-bg); color: var(--done); }
.it__ic--relaciones { background: var(--cat-social-bg); color: var(--cat-social); }
.it__ic--desarrollo { background: var(--cat-personal-bg); color: var(--cat-personal); }
.it__text { flex: 1; min-width: 0; }
.it__t { font-size: 15px; font-weight: 600; display: block; }
.it__s { font-size: 12px; color: var(--muted); display: block; }
.it__ch { color: var(--muted); font-size: 20px; }
.settings__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.settings__row:first-child { border-top: 0; }
.foot-note { text-align: center; font-size: 12px; color: var(--muted); }
