:root {
  --bg: #0A0F1E;
  --surface: #0F1929;
  --surface2: #1A2744;
  --border: #1E2D42;
  --text: #FFFFFF;
  --muted: #8892A4;
  --accent-start: #00C9FF;
  --accent-end: #92FE9D;
  --accent: linear-gradient(90deg, var(--accent-start), var(--accent-end));
  --urgente: #F5576C;
  --medio: #F093FB;
  --ok: #92FE9D;
  --pomodoro: linear-gradient(135deg, #F093FB, #F5576C);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow: 0 24px 80px rgba(0, 201, 255, 0.08);
  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: 'Inter', sans-serif;
  background: radial-gradient(circle at top, rgba(0, 201, 255, 0.12), transparent 34%),
              linear-gradient(180deg, #08101F 0%, #0A0F1E 100%);
  color: var(--text);
}

body {
  overflow-x: hidden;
}

button, input, select, textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ── HEADER ─────────────────────────────────────────────────────────────── */

.app-header {
  padding: 24px 28px 12px;
  background: transparent;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(0, 201, 255, 0.18);
}

.brand-label {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ── NAV SUPERIOR ───────────────────────────────────────────────────────── */

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.top-nav__links {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.top-nav__link {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: color 0.2s ease;
}

.top-nav__link:hover {
  color: var(--text);
}

.account-icon {
  margin-right: 4px;
}

/* ── HERO ───────────────────────────────────────────────────────────────── */

.hero {
  padding: 20px 0 8px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.hero__text {
  max-width: 560px;
  flex: 1 1 420px;
  min-width: 0;
}

.hero__art {
  flex: 1 1 340px;
  max-width: 380px;
  display: none;
}

.hero__art-svg {
  width: 100%;
  height: auto;
}

@media (min-width: 860px) {
  .hero__art { display: block; }
}

.hero-card {
  animation: hero-float 5s ease-in-out infinite;
  transform-origin: center;
}

.hero-card--main { animation: none; }
.hero-card--float-1 { animation-delay: 0.3s; }
.hero-card--float-2 { animation-delay: 1.1s; animation-duration: 6s; }
.hero-card--dot-1 { animation: hero-float 4s ease-in-out infinite; animation-delay: 0.6s; }
.hero-card--dot-2 { animation: hero-float 4.5s ease-in-out infinite; animation-delay: 1.4s; }
.hero-card--dot-3 { animation: hero-float 3.6s ease-in-out infinite; animation-delay: 0.2s; }

@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-card { animation: none; }
}

.hero__eyebrow {
  color: var(--accent-start);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin: 0 0 12px;
}

.hero__title {
  margin: 0 0 16px;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.15;
}

.hero__title-accent {
  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__subtitle {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 24px;
}

.btn--hero {
  font-size: 15px;
  padding: 15px 28px;
}

.hero__features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}

.hero__feature {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.hero__feature-icon {
  width: 15px;
  height: 15px;
  color: var(--accent-start);
}

.hero-sync {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-sync__label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0;
}

.hero-sync__icons {
  display: flex;
  gap: 10px;
}

.hero-sync__icons span {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  font-size: 16px;
}

.hero-sync__icons span img {
  width: 18px;
  height: 18px;
}

.header-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

/* ── NIVEL / RACHA (gamificación) ──────────────────────────────────────── */

.nivel-card {
  margin-top: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgba(0, 201, 255, 0.1), rgba(146, 254, 157, 0.06));
  border: 1px solid rgba(0, 201, 255, 0.18);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: card-in 0.4s ease both;
}

.nivel-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(0, 201, 255, 0.1);
}

.nivel-card:empty { display: none; }

.nivel-card__icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  font-size: 22px;
  animation: nivel-icon-pulse 2.4s ease-in-out infinite;
}

@keyframes nivel-icon-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.nivel-card__body { flex: 1; min-width: 0; }

.nivel-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.nivel-card__nombre {
  font-weight: 700;
  font-size: 14px;
}

.nivel-card__racha {
  font-size: 12px;
  color: var(--medio);
  font-weight: 600;
}

.nivel-card__bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 6px;
}

.nivel-card__bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.nivel-card__siguiente {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.nivel-card__siguiente strong {
  color: var(--text);
}

/* ── PERFIL / MI CUENTA ─────────────────────────────────────────────────── */

.perfil-body {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.perfil-avatar {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #07171b;
  font-weight: 700;
  font-size: 22px;
  display: grid;
  place-items: center;
  text-transform: uppercase;
}

.perfil-datos h3 { margin: 0 0 4px; font-size: 17px; }
.perfil-datos p { margin: 0; color: var(--muted); font-size: 13px; }

.perfil-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.perfil-stat {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  text-align: center;
}

.perfil-stat strong { display: block; font-size: 22px; }
.perfil-stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.perfil-nivel {
  margin-bottom: 18px;
}

.perfil-nivel .nivel-card { margin-top: 0; }

.perfil-zona-peligro {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.btn-link-danger {
  background: none;
  border: none;
  color: #F5576C;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px;
}

.btn-link-danger:hover { opacity: 0.8; }

.stat-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(15, 25, 41, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow-soft);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 10px;
}

.stat-card strong {
  font-size: 28px;
  display: block;
}

/* ── LAYOUT / VISTAS ────────────────────────────────────────────────────── */

.app-main {
  padding: 0 28px 120px;
  max-width: 900px;
  margin: 0 auto;
}

.view {
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.view.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 8px;
}

.view h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
}

/* ── NAV INFERIOR ───────────────────────────────────────────────────────── */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: space-around;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(10, 15, 30, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-btn__icon {
  font-size: 18px;
}

.nav-btn:hover,
.nav-btn.active {
  color: var(--text);
  background: rgba(0, 201, 255, 0.1);
}

.nav-btn:active { transform: scale(0.93); }

.nav-btn__icon { transition: transform 0.2s ease; }
.nav-btn:hover .nav-btn__icon { transform: translateY(-2px) scale(1.08); }

/* ── CHIPS DE CATEGORÍA ─────────────────────────────────────────────────── */

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 16px;
}

.chip-wrap {
  position: relative;
  display: flex;
}

.chip-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  max-width: 280px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.chip-wrap:hover .chip-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.chip-dropdown__vacio {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.chip-dropdown__lista {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
  max-height: 220px;
  overflow-y: auto;
}

.chip-dropdown__lista li {
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.chip-dropdown__lista li:last-child { border-bottom: none; padding-bottom: 0; }

.chip-dropdown__mas {
  color: var(--muted);
  font-style: italic;
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.chip:hover,
.chip.chip--active {
  background: rgba(0, 201, 255, 0.12);
  border-color: rgba(0, 201, 255, 0.3);
  color: var(--text);
  transform: translateY(-1px);
}

.chip:active { transform: scale(0.95); }

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

/* ── CTA DE INVITADO (sin sesión) ───────────────────────────────────────── */

.home-cta {
  display: none;
  text-align: center;
  padding: 40px 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(0, 201, 255, 0.08), rgba(146, 254, 157, 0.04));
  border: 1px solid rgba(0, 201, 255, 0.16);
  margin-bottom: 28px;
  animation: card-in 0.4s ease both;
}

.home-cta.open { display: block; }

.home-cta__icon {
  font-size: 34px;
  margin-bottom: 12px;
}

.home-cta h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.home-cta p {
  margin: 0 auto 22px;
  max-width: 440px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.home-cta__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── TARJETAS DE TAREA ──────────────────────────────────────────────────── */

.task-section {
  display: grid;
  gap: 18px;
}

.task-list {
  display: grid;
  gap: 16px;
}

/* ── CÓMO FUNCIONA ──────────────────────────────────────────────────────── */

.how-section {
  margin-top: 48px;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.how-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.how-card:hover {
  transform: translateY(-3px);
}

.how-card__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(0, 201, 255, 0.1);
  color: var(--accent-start);
  margin-bottom: 14px;
}

.how-card__icon svg {
  width: 22px;
  height: 22px;
}

.how-card__step {
  position: absolute;
  top: 22px;
  right: 22px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.how-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.how-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

@media (max-width: 860px) {
  .how-grid { grid-template-columns: 1fr; }
}

/* ── ACERCA DE ──────────────────────────────────────────────────────────── */

.about-section {
  margin-top: 48px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.about-card:hover {
  transform: translateY(-3px);
}

.about-card__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(0, 201, 255, 0.1);
  color: var(--accent-start);
  margin-bottom: 14px;
}

.about-card__icon svg {
  width: 22px;
  height: 22px;
}

.about-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.about-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
}

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent-start);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, opacity 0.4s ease;
  animation: card-in 0.35s ease both;
}

.task-list .task-card:nth-child(1) { animation-delay: 0.02s; }
.task-list .task-card:nth-child(2) { animation-delay: 0.06s; }
.task-list .task-card:nth-child(3) { animation-delay: 0.1s; }
.task-list .task-card:nth-child(4) { animation-delay: 0.14s; }
.task-list .task-card:nth-child(n+5) { animation-delay: 0.18s; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.task-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 201, 255, 0.12);
}

.task-card:active {
  transform: translateY(-1px) scale(0.99);
}

.task-card__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.task-card__title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}

.task-card__vence {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.task-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.vence--hoy { color: var(--urgente); }
.vence--pronto { color: var(--medio); }
.vence--normal { color: var(--muted); }

.vence-badge {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
}

.materia-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
}

.materia-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge--danger { background: rgba(245, 87, 108, 0.14); color: var(--urgente); }
.badge--warning { background: rgba(240, 147, 251, 0.16); color: var(--medio); }
.badge--success { background: rgba(146, 254, 157, 0.18); color: var(--ok); }

.urgency-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  margin-bottom: 12px;
}

.urgency-bar__fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.urgency-bar__fill--alta { background: var(--urgente); }
.urgency-bar__fill--media { background: var(--medio); }
.urgency-bar__fill--baja { background: var(--ok); }

.task-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.task-card__pomodoro {
  color: var(--muted);
  font-size: 12px;
}

.task-play-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: var(--pomodoro);
  color: #17070c;
  display: grid;
  place-items: center;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.task-play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 24px rgba(240, 147, 251, 0.35);
}

.task-play-btn:active { transform: scale(0.95); }

.task-card--done {
  opacity: 0.6;
  border-left-color: var(--ok);
  transition: opacity 0.4s ease, border-color 0.4s ease;
}

.task-card--done .task-card__title {
  text-decoration: line-through;
}

.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
}

.empty-state__icon {
  font-size: 40px;
  display: block;
  margin-bottom: 18px;
}

.empty-state__text {
  color: var(--muted);
  font-size: 15px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  margin-bottom: 20px;
}

.dashboard-card h3 {
  margin: 0 0 18px;
  font-size: 17px;
}

/* ── VISTA SEMANAL ──────────────────────────────────────────────────────── */

.semana-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.semana-resumen {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 20px;
}

.semana-resumen .badge {
  padding: 8px 14px;
  font-size: 12px;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: end;
  min-height: 180px;
}

.bar-day {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.bar-day__stacks {
  width: 100%;
  display: grid;
  gap: 3px;
  align-items: end;
  min-height: 120px;
}

.bar-stack-seg {
  width: 100%;
  border-radius: 999px;
}

.bar-day__label {
  color: var(--muted);
  font-size: 11px;
}

.bar-day--overload .bar-day__label {
  color: var(--urgente);
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pomodoro-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.pom-stat {
  flex: 1;
  min-width: 110px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
}

.pom-stat__num {
  font-size: 22px;
  font-weight: 700;
}

.pom-stat__label {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.materia-progress {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mat-prog-row {
  display: grid;
  grid-template-columns: 120px 1fr 40px;
  align-items: center;
  gap: 10px;
}

.mat-prog-name {
  font-size: 12px;
  font-weight: 700;
}

.mat-prog-bar {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}

.mat-prog-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.mat-prog-pct {
  text-align: right;
  font-size: 11px;
  color: var(--muted);
}

/* ── MODAL ──────────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(9, 16, 32, 0.78);
  backdrop-filter: blur(12px);
  z-index: 40;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open {
  display: flex;
}


.sync-apps {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.sync-apps__label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 12px;
}

.sync-apps__icons {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.sync-apps__icons span {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  font-size: 17px;
}

.sync-apps__icons span img {
  width: 19px;
  height: 19px;
}

.modal {
  width: min(680px, 100%);
  background: rgba(15, 25, 41, 0.98);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px;
  max-height: min(90vh, 900px);
  overflow-y: auto;
  animation: modal-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal__close {
  transition: transform 0.2s ease, background 0.2s ease;
}

.modal__close:hover {
  background: rgba(255,255,255,0.14);
  transform: rotate(90deg);
}

.modal--form { max-width: 640px; }
.modal--detalle { max-width: 520px; }

.modal__header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.modal__title {
  margin: 0;
  font-size: 24px;
}

.modal__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.modal__form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

.field textarea {
  min-height: 80px;
  resize: vertical;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field.full-width {
  grid-column: 1 / -1;
}

.form-row:not(.grid-2) {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.form-row:not(.grid-2) > .field {
  flex: 1;
  min-width: 160px;
}

.auth-forgot {
  margin: -8px 0 12px;
  text-align: right;
}

.link-inline {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-start, #00C9FF);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}

.link-inline:hover {
  opacity: 0.8;
}

.categoria-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.categoria-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent-start);
}

.categoria-nueva-form {
  display: none;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.categoria-nueva-form.open {
  display: flex;
}

.categoria-nueva-form input[type="text"] {
  flex: 1;
}

.categoria-nueva-form input[type="color"] {
  width: 44px;
  height: 40px;
  padding: 2px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.range-value {
  color: var(--muted);
  font-size: 12px;
}

.priority-buttons {
  display: flex;
  gap: 8px;
}

.priority-btn {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  padding: 10px 0;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.priority-btn.active,
.priority-btn:hover {
  background: rgba(0, 201, 255, 0.16);
  color: var(--text);
}

.field--toggle .toggle-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  transition: transform 0.2s ease;
}

.switch input:checked + .slider {
  background: var(--accent);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.form-error {
  font-size: 11px;
  color: var(--urgente);
  min-height: 14px;
}

.modal-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 4px;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.modal__actions--split {
  justify-content: space-between;
}

/* ── DETALLE DE TAREA ───────────────────────────────────────────────────── */

.detalle-materia-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.detalle-body {
  display: grid;
  gap: 18px;
}

.detalle-urgencia-banner {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14px;
  background: rgba(245, 87, 108, 0.14);
  color: var(--urgente);
  border: 1px solid rgba(245, 87, 108, 0.3);
}

.detalle-desc {
  color: var(--muted);
  line-height: 1.7;
}

.categoria-detalle-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 16px;
  margin-bottom: 6px;
  color: #07171b;
}

.categoria-detalle-body {
  display: grid;
  gap: 18px;
}

.categoria-detalle-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.categoria-detalle-chart {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
}

.mini-chart { display: grid; gap: 10px; }

.mini-chart__fila {
  display: grid;
  grid-template-columns: 90px 1fr 24px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.mini-chart__label { color: var(--muted); }

.mini-chart__pista {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}

.mini-chart__barra {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.mini-chart__valor { text-align: right; font-weight: 700; }

.mini-chart__vacio {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.categoria-detalle-lista__items {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.categoria-detalle-lista__items li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  font-size: 13px;
}

.categoria-detalle-lista__vacio {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.detalle-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detalle-meta-card {
  padding: 14px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  font-size: 13px;
}

.detalle-pomodoro-progreso {
  display: grid;
  gap: 8px;
}

.detalle-pomodoro-progreso__top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.detalle-tiempo-real {
  color: var(--muted);
  font-size: 12px;
}

.detalle-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.detalle-actions--split {
  justify-content: space-between;
}

.detalle-secondary-actions {
  display: flex;
  gap: 12px;
}

/* ── PANTALLA POMODORO FULLSCREEN ───────────────────────────────────────── */

.pomodoro-fullscreen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #050810;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 32px;
  text-align: center;
}

.pomodoro-fullscreen.open {
  display: flex;
}

.pomodoro-fs-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
}

.pomodoro-fs-subtitle {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.pomodoro-fs-ring {
  position: relative;
  width: 340px;
  height: 340px;
  max-width: 80vw;
  max-height: 80vw;
  display: grid;
  place-items: center;
}

.pomodoro-fs-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: #0F1929;
  stroke-width: 14;
}

.ring-progress {
  fill: none;
  stroke: url(#pomodoroGradient);
  stroke: #F5576C;
  stroke-width: 14;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.pomodoro-fs-center {
  position: absolute;
  display: grid;
  place-items: center;
  gap: 8px;
}

.pomodoro-fs-time {
  font-size: 72px;
  font-weight: 200;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pomodoro-fs-label {
  color: var(--muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.pomodoro-controls {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.pom-btn {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.pom-btn:hover {
  background: rgba(255,255,255,0.14);
  transform: translateY(-1px);
}

.pom-btn--main {
  width: 72px;
  height: 72px;
  background: var(--pomodoro);
  color: #1a060a;
  font-size: 24px;
}

.pom-btn--main.running {
  background: var(--urgente);
}

.pomodoro-sessions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.session-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
}

.session-dot.done { background: var(--medio); }
.session-dot.active { box-shadow: 0 0 0 4px rgba(240,147,251,0.18); }

.pomodoro-fs-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
}

.fs-stat {
  display: grid;
  gap: 4px;
}

.fs-stat strong {
  font-size: 22px;
}

.fs-stat span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── BOTONES / TOAST ────────────────────────────────────────────────────── */

.btn {
  appearance: none;
  border: none;
  border-radius: var(--radius-pill);
  padding: 13px 22px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.97); }

.btn--ghost { background: rgba(255,255,255,0.05); color: var(--text); }

.btn--primary {
  background: var(--accent);
  color: #07171b;
  box-shadow: 0 20px 50px rgba(0, 201, 255, 0.18);
}

.btn--primary:hover {
  box-shadow: 0 20px 50px rgba(0, 201, 255, 0.32);
}

.btn--success { background: rgba(146, 254, 157, 0.16); color: var(--ok); }
.btn--danger { background: rgba(245, 87, 108, 0.16); color: var(--urgente); }

.btn--pomodoro {
  width: 100%;
  background: var(--pomodoro);
  color: #1a060a;
}

.btn--social {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
  width: 100%;
}

.btn--small { padding: 9px 16px; font-size: 12px; }

.google-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.12);
}

.social-login { margin-top: 14px; }

.task-timer {
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  flex-wrap: wrap;
}

.task-timer.timer-urgent { border-color: var(--urgente); background: rgba(245, 87, 108, 0.12); color: var(--urgente); }
.task-timer.timer-medium { border-color: var(--medio); background: rgba(240, 147, 251, 0.12); color: var(--medio); }
.task-timer.timer-low { border-color: var(--ok); background: rgba(146, 254, 157, 0.12); color: var(--ok); }

.timer-countdown { font-weight: 700; flex: 1 1 auto; min-width: 140px; }
.clock-icon { display: inline-flex; width: 20px; justify-content: center; font-size: 15px; }

.timer-blink { animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

.fab {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #07171b;
  font-size: 30px;
  cursor: pointer;
  box-shadow: 0 24px 48px rgba(0, 201, 255, 0.2);
  display: none;
  place-items: center;
  z-index: 20;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fab.fab--visible {
  display: grid;
}

.fab:hover {
  transform: scale(1.08) rotate(90deg);
  box-shadow: 0 24px 48px rgba(0, 201, 255, 0.38);
}

.fab:active { transform: scale(0.94) rotate(90deg); }

.toast-container {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 12px;
  /* Por encima de cualquier modal abierto (.modal-overlay, z-index 40) para que
     los errores de acceso (email/contraseña incorrectos) se vean. */
  z-index: 50;
  width: min(360px, calc(100% - 32px));
}

.toast {
  padding: 14px 18px;
  border-radius: 16px;
  color: var(--text);
  background: rgba(15, 25, 41, 0.96);
  border: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  box-shadow: var(--shadow);
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast--leaving {
  opacity: 0;
  transform: translateY(10px) scale(0.96);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.toast--success { border-color: rgba(146, 254, 157, 0.2); }
.toast--error { border-color: rgba(245, 87, 108, 0.25); }
.toast--warning { border-color: rgba(240, 147, 251, 0.25); }
.toast--info { border-color: rgba(0, 201, 255, 0.25); }

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .header-summary { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .app-main { padding: 0 16px 120px; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  .stat-card { padding: 14px; }
  .task-card { padding: 16px; }
  .pomodoro-fs-time { font-size: 52px; }
  .pomodoro-fs-ring { width: 260px; height: 260px; }
  .hero__title { font-size: 28px; }
}

/* ── FOOTER: ACERCA DE / CONTACTO ───────────────────────────────────────── */

.site-footer {
  max-width: 900px;
  margin: 48px auto 0;
  padding: 32px 28px calc(100px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.footer-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.footer-section p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 10px;
}

.footer-link {
  color: var(--accent-start);
  font-size: 13px;
  font-weight: 600;
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.footer-social a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: background 0.2s ease;
}

.footer-social a:hover {
  background: rgba(0, 201, 255, 0.16);
}

.footer-copy {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0 0;
}

@media (max-width: 640px) {
  .site-footer { grid-template-columns: 1fr; padding: 24px 16px calc(100px + env(safe-area-inset-bottom)); }
}

/* ── MICRO-INTERACCIONES: accesibilidad de foco ────────────────────────── */

:is(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-start);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Respetar preferencia de movimiento reducido en toda la interfaz */
@media (prefers-reduced-motion: reduce) {
  .task-card,
  .nivel-card,
  .nivel-card__icon,
  .modal,
  .toast,
  .fab,
  .task-play-btn,
  .nav-btn__icon {
    animation: none !important;
    transition: none !important;
  }
}
