/* ===========================================================
   Projeto Lanús 95 — Design System
   Tema: dark premium, vermelho como cor de força/ação, alto contraste.
   Mobile first — a versão desktop transforma a navegação inferior
   em uma sidebar fixa (ver media query no final do arquivo).
=========================================================== */

:root {
  /* Paleta */
  --bg-app: #0d0d0d;
  --bg-surface: #141414;
  --bg-card: #1f1f1f;
  --bg-card-hover: #262626;
  --border-subtle: #2a2a2a;

  --red: #e53935;
  --red-hover: #ff3b30;
  --red-glow: rgba(229, 57, 53, 0.35);

  --white: #ffffff;
  --text-muted: #aaaaaa;
  --text-faint: #737373;

  --success: #27ae60;
  --warning: #f2c94c;
  --danger: #ff5b5b;

  /* Tipografia */
  --font-display: 'Oswald', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;

  /* Espaçamento e forma */
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 11px;

  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-red: 0 10px 28px rgba(229, 57, 53, 0.25);

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-width: 240px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden; /* o scroll acontece dentro de .app-main, não na página */
}

body {
  background: var(--bg-app);
  color: var(--white);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  height: 100dvh;
}

.hidden {
  display: none !important;
}

h1, h2, h3, .number-display {
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}

/* =========================
   Animações
========================= */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -300px 0; }
  100% { background-position: 300px 0; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 var(--red-glow); }
  50% { box-shadow: 0 0 0 8px rgba(229, 57, 53, 0); }
}

.fade-in {
  animation: fadeIn var(--transition-slow) ease both;
}

.slide-up {
  animation: slideUp var(--transition-slow) ease both;
}

/* aplica um leve atraso em cascata para filhos diretos de listas/grids */
.stagger > * {
  animation: slideUp var(--transition-slow) ease both;
}
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; }
.stagger > *:nth-child(4) { animation-delay: 0.14s; }
.stagger > *:nth-child(5) { animation-delay: 0.18s; }
.stagger > *:nth-child(6) { animation-delay: 0.22s; }
.stagger > *:nth-child(7) { animation-delay: 0.26s; }
.stagger > *:nth-child(8) { animation-delay: 0.3s; }

.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 37%, var(--bg-card) 63%);
  background-size: 400px 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
}

/* =========================
   Tela de login
========================= */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 30% 20%, rgba(229, 57, 53, 0.16), transparent 55%),
    linear-gradient(160deg, #141414, #0d0d0d 70%);
  z-index: 300;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.login-card h1 {
  font-size: 1.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.login-card h1 span {
  color: var(--red);
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 6px;
  font-family: var(--font-body);
}

.login-card input[type="password"] {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--white);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.login-card input[type="password"]:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.login-error {
  color: var(--danger);
  font-size: 0.82rem;
  min-height: 1em;
}

/* =========================
   App shell (header + main + nav)
========================= */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

/* =========================
   Cabeçalho
========================= */
.app-header {
  flex-shrink: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 20px;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 720px;
  margin: 0 auto;
}

.app-header h1 {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.app-header h1 span {
  color: var(--red);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(229, 57, 53, 0.12);
  border: 1px solid rgba(229, 57, 53, 0.3);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--red);
  font-family: var(--font-display);
}

.streak-fire {
  font-size: 1rem;
}

.logout-btn {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 1rem;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), transform var(--transition);
}

.logout-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.logout-btn:active {
  transform: scale(0.92);
}

/* =========================
   Conteúdo principal
========================= */
.app-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.app-main-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 32px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn var(--transition-slow) ease both;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 18px;
  font-family: var(--font-body);
}

.section-date {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
  text-transform: capitalize;
}

/* =========================
   Hero (Início)
========================= */
.hero-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 20px;
  overflow: hidden;
  background:
    linear-gradient(140deg, rgba(13, 13, 13, 0.65), rgba(229, 57, 53, 0.28)),
    url('https://images.unsplash.com/photo-1517836357463-d25dfeac3438?auto=format&fit=crop&w=1200&q=60') center 30% / cover;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.hero-eyebrow {
  color: var(--red);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.hero-greeting {
  font-size: 1.6rem;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.15;
  margin-bottom: 6px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.hero-tagline {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.92rem;
  margin-bottom: 18px;
  font-family: var(--font-body);
}

/* =========================
   Botões
========================= */
.primary-button {
  background: linear-gradient(90deg, var(--red), var(--red-hover));
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 15px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: var(--shadow-red);
  transition: filter var(--transition), transform var(--transition);
}

.primary-button:active {
  transform: scale(0.97);
  filter: brightness(0.92);
}

.secondary-button {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 15px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}

.secondary-button:hover {
  border-color: var(--red);
  color: var(--white);
}

.secondary-button:active {
  transform: scale(0.97);
}

.text-link-button {
  background: none;
  border: none;
  color: var(--red);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 0;
}

/* =========================
   Cards genéricos
========================= */
.card, .glass-card, .metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
}

.glass-card {
  background: rgba(31, 31, 31, 0.6);
  backdrop-filter: blur(10px);
}

.card:active, .metric-card:active {
  transform: scale(0.98);
}

/* =========================
   Cards de métrica (dashboard)
========================= */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  padding: 16px;
}

.metric-card.accent {
  background: linear-gradient(150deg, rgba(229, 57, 53, 0.16), var(--bg-card));
  border-color: rgba(229, 57, 53, 0.4);
}

.metric-icon {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.metric-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 6px;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 4px;
}

.metric-sub {
  font-size: 0.76rem;
  color: var(--text-faint);
  margin-bottom: 10px;
}

/* Barra de progresso genérica */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red), var(--red-hover));
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.metric-card.accent .progress-fill {
  background: linear-gradient(90deg, #1f9d5c, var(--success));
}

/* =========================
   Toggles modernos (hábitos do dia)
========================= */
.habit-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.habit-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.habit-toggle:active {
  transform: scale(0.98);
}

.habit-toggle.checked {
  background: rgba(39, 174, 96, 0.1);
  border-color: rgba(39, 174, 96, 0.4);
}

.habit-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.habit-text {
  font-weight: 600;
  font-size: 0.86rem;
  flex-grow: 1;
}

.habit-toggle.checked .habit-text {
  color: var(--success);
}

.switch {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--border-subtle);
  transition: background var(--transition);
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  transition: transform var(--transition);
}

.habit-toggle.checked .switch {
  background: var(--success);
}

.habit-toggle.checked .switch::after {
  transform: translateX(18px);
}

/* =========================
   Treinos — accordion
========================= */
.workout-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.workout-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border-left: 3px solid var(--border-subtle);
}

.workout-card.today {
  border-left-color: var(--red);
  box-shadow: var(--shadow-red);
}

.workout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  cursor: pointer;
}

.workout-header-text {
  flex-grow: 1;
}

.workout-day {
  font-size: 0.74rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.workout-card.today .workout-day {
  color: var(--red);
}

.workout-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.today-tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.66rem;
  background: var(--red);
  color: var(--white);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 800;
  vertical-align: middle;
  font-family: var(--font-body);
}

.workout-chevron {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: transform var(--transition);
  flex-shrink: 0;
  margin-left: 10px;
}

.workout-card.expanded .workout-chevron {
  transform: rotate(180deg);
}

.workout-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.workout-card.expanded .workout-body {
  max-height: 2000px;
}

.workout-body-inner {
  padding: 0 18px 18px;
}

.workout-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.workout-block-title {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--red);
  font-weight: 700;
  margin-bottom: 8px;
  font-family: var(--font-display);
}

.workout-exercise-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.workout-exercise-list li {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding-left: 14px;
  position: relative;
}

.workout-exercise-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--red);
}

.workout-log-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-subtle);
}

.workout-log-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* =========================
   Formulários
========================= */
.registro-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.form-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-label input[type="number"],
.form-label input[type="text"],
.form-label input[type="date"],
.form-label select,
.form-label textarea {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--white);
  font-size: 1rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-label input:focus,
.form-label select:focus,
.form-label textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.form-label textarea {
  resize: vertical;
}

.form-label input[type="range"] {
  accent-color: var(--red);
  width: 100%;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.range-value {
  align-self: flex-end;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--red);
  font-size: 1.1rem;
}

.form-section-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 4px;
}

/* Histórico de registros */
.history-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
  font-family: var(--font-display);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.history-item-date {
  font-size: 0.76rem;
  color: var(--red);
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.history-item-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.history-item-grid b {
  color: var(--white);
}

.history-item-obs {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}

.history-empty {
  color: var(--text-faint);
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
}

/* =========================
   Progresso — tabs de métrica
========================= */
.metric-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.metric-tab {
  flex: 1 0 auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.metric-tab.active {
  background: var(--red);
  color: var(--white);
}

.metric-chart-panel {
  display: none;
}

.metric-chart-panel.active {
  display: block;
  animation: fadeIn var(--transition-slow) ease both;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}

.chart-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-family: var(--font-display);
}

.chart-card canvas {
  width: 100% !important;
  max-height: 240px;
}

/* =========================
   Pesquisa por período
========================= */
.search-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.search-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.search-fields {
  display: none;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.search-fields.expanded {
  display: flex;
}

.search-actions {
  display: flex;
  gap: 10px;
}

.search-actions .primary-button,
.search-actions .secondary-button {
  flex: 1;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.report-summary:empty {
  display: none;
}

.report-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.report-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.report-stat-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.report-observacoes {
  grid-column: 1 / -1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.report-observacoes-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.report-observacoes-item {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 6px 0;
  border-top: 1px solid var(--border-subtle);
}

.report-observacoes-item:first-child {
  border-top: none;
}

.report-observacoes-item b {
  color: var(--red);
  margin-right: 6px;
}

/* =========================
   Perfil
========================= */
.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--red), var(--red-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  font-family: var(--font-display);
  flex-shrink: 0;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-tagline {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.profile-goals-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.profile-goal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.profile-goal-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.profile-goal-value {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--red);
}

/* =========================
   Navegação inferior (mobile)
========================= */
.bottom-nav {
  flex-shrink: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-faint);
  font-family: var(--font-body);
  padding: 6px 2px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.nav-btn.active {
  color: var(--red);
}

.nav-icon {
  font-size: 1.25rem;
  transition: transform var(--transition);
}

.nav-btn.active .nav-icon {
  transform: translateY(-2px);
}

.nav-label {
  font-size: 0.65rem;
  font-weight: 700;
}

.nav-btn-fab {
  position: relative;
}

.nav-btn-fab .nav-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--red), var(--red-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-top: -26px;
  box-shadow: var(--shadow-red);
  border: 4px solid var(--bg-surface);
}

.nav-btn-fab.active .nav-icon {
  animation: pulseGlow 1.8s ease infinite;
}

.nav-btn-fab .nav-label {
  margin-top: -2px;
}

/* =========================
   Responsivo — tablet
========================= */
@media (min-width: 640px) {
  .cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .habit-toggle-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 480px) {
  .history-item-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* =========================
   Responsivo — desktop (sidebar)
========================= */
@media (min-width: 960px) {
  .app-shell {
    flex-direction: row;
  }

  .app-header {
    display: none;
  }

  .bottom-nav {
    order: -1;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: var(--sidebar-width);
    height: 100%;
    border-top: none;
    border-right: 1px solid var(--border-subtle);
    padding: 28px 14px;
    gap: 6px;
  }

  .bottom-nav::before {
    content: 'PROJETO LANÚS 95';
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    color: var(--white);
    padding: 0 10px 22px;
  }

  .nav-btn {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
  }

  .nav-btn.active {
    background: rgba(229, 57, 53, 0.12);
  }

  .nav-btn .nav-label {
    font-size: 0.85rem;
  }

  .nav-btn-fab .nav-icon {
    width: 28px;
    height: 28px;
    margin-top: 0;
    font-size: 0.95rem;
    border: none;
    box-shadow: none;
  }

  .nav-btn-fab.active .nav-icon {
    animation: none;
  }

  .app-main-inner {
    max-width: 880px;
    padding: 40px 32px;
  }

  .cards-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .habit-toggle-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
