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

* { box-sizing: border-box; }

body { font-family: 'Inter', sans-serif; }

.gradient-text {
  background: linear-gradient(135deg, #f97316, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* CARDS */
.card {
  background: rgb(17 24 39);
  border: 1px solid rgb(31 41 55);
  border-radius: 16px;
  padding: 24px;
  transition: border-color 0.2s;
}
.card:hover {
  border-color: rgb(55 65 81);
}

/* STAT CARDS */
.stat-card {
  background: rgb(17 24 39);
  border: 1px solid rgb(31 41 55);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.2s;
}
.stat-card:hover {
  border-color: rgb(55 65 81);
  transform: translateY(-2px);
}
.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgb(107 114 128);
  margin-bottom: 6px;
}
.stat-value {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-sub {
  font-size: 11px;
  color: rgb(75 85 99);
  margin-bottom: 10px;
}
.stat-bar {
  height: 4px;
  border-radius: 99px;
  width: 100%;
}

/* SECTION TITLES */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  margin-bottom: 2px;
}

/* INPUTS */
.input-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: rgb(156 163 175);
  margin-bottom: 8px;
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 99px;
  background: rgb(55 65 81);
  outline: none;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f97316;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(249 115 22 / 0.3);
  transition: box-shadow 0.2s;
}
.slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 6px rgba(249 115 22 / 0.3);
}

/* ACTIVITY BUTTONS */
.activity-btn {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  background: rgb(31 41 55);
  border: 1px solid rgb(55 65 81);
  color: rgb(156 163 175);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.activity-btn:hover {
  background: rgb(55 65 81);
  color: white;
}
.activity-btn.active {
  background: rgba(249 115 22 / 0.15);
  border-color: rgb(249 115 22);
  color: rgb(249 115 22);
  font-weight: 600;
}

/* MATH ROWS */
.math-row {
  display: flex;
  align-items: center;
  font-size: 13px;
}

/* TABLE */
table td, table th {
  white-space: nowrap;
}

.seguimiento-input {
  width: 60px;
  background: rgb(31 41 55);
  border: 1px solid rgb(55 65 81);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
  color: white;
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
}
.seguimiento-input:focus {
  border-color: rgb(249 115 22);
}

.row-actual {
  background: rgba(249 115 22 / 0.05);
}
.row-actual td {
  border-left: 2px solid rgb(249 115 22);
}

/* WELLBEING SLIDER */
.wb-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: rgb(55 65 81);
  outline: none;
  cursor: pointer;
}
.wb-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  cursor: pointer;
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgb(55 65 81); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgb(75 85 99); }

/* ANIMATIONS */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card, .stat-card {
  animation: fadeUp 0.4s ease both;
}

/* ── MOBILE RESPONSIVE ─────────────────────────────────── */

/* Evita zoom al tocar inputs en iOS */
input, select, textarea {
  font-size: 16px !important;
  touch-action: manipulation;
}
/* Excepción: labels y spans pequeños no se afectan */
.text-xs, .text-sm { font-size: inherit; }

/* Sliders más grandes en móvil (fácil de tocar) */
@media (max-width: 640px) {
  .slider::-webkit-slider-thumb {
    width: 26px;
    height: 26px;
  }
  .wb-slider::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
  }

  /* Cards con menos padding en móvil */
  .card {
    padding: 16px;
    border-radius: 12px;
  }
  .stat-card {
    padding: 14px;
    border-radius: 12px;
  }

  /* Stat values más pequeños en móvil */
  .stat-value {
    font-size: 1.6rem;
  }

  /* Activity buttons: más altura para tocar bien */
  .activity-btn {
    padding: 10px 8px;
    font-size: 11px;
    min-height: 44px;
  }

  /* Seguimiento inputs más grandes en móvil */
  .seguimiento-input {
    width: 52px;
    padding: 6px 4px;
    min-height: 36px;
  }

  /* Inputs tipo gram */
  .gram-input {
    width: 60px;
    min-height: 40px;
  }

  /* Math rows más legibles */
  .math-row {
    font-size: 12px;
    flex-wrap: wrap;
    gap: 2px;
  }

  /* Botones flotantes de sync no se solapan con el contenido */
  #toast-saved {
    bottom: 80px;
    right: 12px;
    left: 12px;
    font-size: 13px;
  }
}

/* Header responsive */
@media (max-width: 480px) {
  .header-badge-hide {
    display: none;
  }
}

/* Tablas: siempre scroll horizontal, nunca rompen el layout */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}

/* Asegura que las tablas no colapsen */
table {
  min-width: max-content;
}

/* Day cells del tracker ZPB más grandes en móvil */
@media (max-width: 640px) {
  .day-cell {
    width: 28px !important;
    height: 28px !important;
    font-size: 10px !important;
  }
  #tracker-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 6px !important;
  }
}

/* Gráficas no se salen del contenedor */
canvas {
  max-width: 100%;
}
