@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  /* Paleta PetWise — mobile-first, dark por padrão */
  --primary: #1DB954;
  --primary-dark: #0F8C3B;
  --secondary: #FF6B35;
  --accent: #7C3AED;
  --bg: #0F1923;
  --card: #1A2535;
  --card-2: #243040;
  --text: #F0F4F8;
  --muted: #8899AA;
  --info: #1DB954;
  --attention: #FBBF24;
  --urgent: #FF6B35;
  --critical: #EF4444;
  --radius: 20px;
  --radius-btn: 14px;
  --radius-chip: 999px;
  --radius-input: 12px;
  --shadow-card: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow-green: 0 0 20px rgba(29,185,84,0.3);
  --shadow-glow-orange: 0 0 20px rgba(255,107,53,0.3);
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  margin-bottom: 64px; /* espaço para bottom nav fixa */
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
}

h1, h2, h3 { font-family: var(--font-display); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 56px;
  background: linear-gradient(135deg, #0F1923, #1A2535);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  position: sticky;
  top: 0;
  z-index: 900;
}
.top-label {
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 8px 0 4px;
  font-weight: 600;
}
.brand { display: flex; align-items: center; gap: 6px; font-size: 1.2rem; font-weight: 800; font-family: var(--font-display); color: var(--text); text-decoration: none; }
.brand-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--primary); font-size: 0.95rem;
}
.header-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: 2px solid var(--primary);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; text-decoration: none; flex-shrink: 0;
  cursor: pointer;
}
.avatar-menu-wrap { position: relative; flex-shrink: 0; }
.avatar-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--card-2);
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow-card);
  min-width: 160px;
  z-index: 1000;
  overflow: hidden;
}
.avatar-menu.avatar-menu-open { display: flex; flex-direction: column; }
.avatar-menu a {
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--card-2);
}
.avatar-menu a:last-child { border-bottom: none; }
.avatar-menu a:hover { background: var(--card-2); }
.avatar-menu-link-desktop { display: block; }
.avatar-menu-link-mobile { display: none; }
@media (max-width: 640px) {
  .avatar-menu-link-desktop { display: none; }
  .avatar-menu-link-mobile { display: block; }
}
.urgent-bar {
  background: rgba(239,68,68,0.15);
  color: #FF9B9B;
  border-bottom: 1px solid rgba(239,68,68,0.3);
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  animation: criticalPulse 1.8s ease-in-out infinite;
}
.nav a { margin-left: 18px; color: var(--text); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--primary); }
.btn-link {
  background: var(--primary);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: var(--radius-chip);
}

/* Menu hambúrguer (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--primary-dark);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle-open span:nth-child(2) { opacity: 0; }
.nav-toggle-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.back-btn {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.back-btn:hover { text-decoration: underline; }

.link-primary { color: var(--primary); font-weight: 600; }
.link-primary:hover { text-decoration: underline; }

.container { max-width: 960px; margin: 0 auto; padding: 24px 20px 24px; }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; }
  .nav-toggle { display: flex; }
  .nav {
    display: none;
    flex-direction: column;
    width: 100%;
    background: var(--card);
    margin-top: 12px;
    border-top: 1px solid var(--card-2);
    padding-top: 10px;
  }
  .nav.nav-open { display: flex; }
  .nav a {
    margin-left: 0;
    padding: 12px 4px;
    border-bottom: 1px solid var(--card-2);
  }
  .nav a:last-child { border-bottom: none; }
  .btn-link { display: inline-block; width: fit-content; }
  /* Em mobile, o menu de texto some — a navegação principal passa pela bottom nav */
  .nav-toggle, .nav { display: none !important; }
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
  animation: fadeSlideUp 0.35s ease both;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.card:nth-of-type(2) { animation-delay: 0.05s; }
.card:nth-of-type(3) { animation-delay: 0.1s; }
.card:nth-of-type(4) { animation-delay: 0.15s; }

/* ===== Transição de página (estilo app nativo) — View Transitions API ===== */
@supports (view-transition-name: root) {
  ::view-transition-old(root) { animation: pageOut 0.18s ease forwards; }
  ::view-transition-new(root) { animation: pageIn 0.22s ease forwards; }
}
@keyframes pageOut { to { opacity: 0; transform: translateX(-12px); } }
@keyframes pageIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }

/* ===== Bottom Navigation (mobile) ===== */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 64px;
  background: linear-gradient(135deg, #0F1923, #1A2535);
  border-top: 1px solid var(--card-2);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.35);
  z-index: 950;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (max-width: 768px) {
  .bottom-nav { display: flex; }
  .topbar .nav, .topbar .nav-toggle { display: none; }
  body.has-bottom-nav .container { padding-bottom: 84px; }
}
.bottom-nav-list {
  display: flex;
  width: 100%;
  height: 64px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bottom-nav-item { flex: 1; }
.bottom-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 100%;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  position: relative;
  transition: transform 0.15s ease;
}
.bottom-nav-link svg { width: 22px; height: 22px; }
.bottom-nav-link:active { transform: scale(0.9); }
.bottom-nav-link.active { color: var(--primary); }
.bottom-nav-link.active::before {
  content: '';
  position: absolute;
  top: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.18;
  box-shadow: var(--shadow-glow-green);
}
.bottom-nav-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 18px);
  background: var(--secondary);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 999px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* FAB */
.fab {
  position: fixed;
  right: 18px;
  bottom: 80px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow-green), 0 6px 16px rgba(0,0,0,0.4);
  border: none;
  cursor: pointer;
  z-index: 940;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.fab:active { transform: scale(0.92); }
@media (min-width: 769px) { .fab { bottom: 24px; } }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.pet-card { display: block; text-decoration: none; color: inherit; }
.pet-card img { width: 100%; height: 160px; object-fit: contain; border-radius: var(--radius) var(--radius) 0 0; background:#fff; }
.pet-card .pet-card-body { padding: 14px; }

h1, h2, h3 { color: var(--primary-dark); }

.pet-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pet-header h1 { margin: 0; white-space: nowrap; }
.pet-actions { display: flex; gap: 6px; flex-shrink: 0; }

.log-detail-list { margin: 6px 0; }
.log-detail-list p { margin: 4px 0; }

@media (max-width: 640px) {
  .pet-header h1 { font-size: 1.5rem; }
  .pet-actions .btn { padding: 7px 12px; font-size: 0.82rem; white-space: nowrap; }
}

form .field { margin-bottom: 16px; }
.date-select-row { display: grid; grid-template-columns: 1fr 1.3fr 1.2fr; gap: 8px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--card-2);
  background: var(--card-2);
  color: var(--text);
  border-radius: var(--radius-input);
  font-size: 1rem;
  font-family: inherit;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); }

.password-field { position: relative; }
.password-field input { padding-right: 44px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 6px;
  line-height: 1;
}
.code-input {
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: 0.5em;
  font-family: var(--font-mono);
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease;
}
.btn:active { transform: scale(0.97); }
.btn:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-danger { background: var(--critical); }
.btn-danger:hover { background: #c0392b; }

@media (max-width: 640px) {
  .btn-block-mobile { display: block; width: 100% !important; text-align: center; flex: 1 1 100% !important; }
}

.badge-plan-pro {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 0.66rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: var(--radius-chip);
  line-height: 1.5;
}

/* ===== Seleção tipo quiz (cards tocáveis) ===== */
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.choice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  padding: 10px 6px 18px;
  border-radius: 12px;
  background: var(--card-2);
  border: 2px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.74rem;
  line-height: 1.25;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.choice-card .choice-icon { font-size: 1.15rem; }
.choice-card:active { transform: scale(0.97); }
.choice-card.selected {
  border-color: var(--primary);
  background: rgba(29,185,84,0.12);
  box-shadow: var(--shadow-glow-green);
}
.choice-card.selected::after {
  content: '✓';
  position: absolute;
  bottom: 5px; right: 5px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.55rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
}
.choice-card input { display: none; }

.log-form-header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }

/* ===== Grid de fotos (formulário diário) ===== */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; cursor: pointer; }
.photo-slot {
  aspect-ratio: 1/1;
  border-radius: var(--radius-btn);
  background-color: var(--card-2);
  background-size: cover;
  background-position: center;
  border: 1px dashed var(--card-2);
}
.photo-slot-add {
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  background-color: rgba(29,185,84,0.18);
  border-color: var(--primary);
  color: var(--primary);
}

.progress-bar { height: 6px; border-radius: 999px; background: var(--card-2); overflow: hidden; margin-bottom: 18px; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); border-radius: 999px; transition: width 0.25s ease; }

/* ===== Skeleton (loading shimmer) ===== */
.skeleton {
  background: linear-gradient(100deg, var(--card) 30%, var(--card-2) 50%, var(--card) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-btn);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-line { height: 14px; margin-bottom: 8px; border-radius: 6px; }
.skeleton-card { height: 90px; border-radius: var(--radius); margin-bottom: 14px; }

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  left: 0; right: 0;
  bottom: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 1100;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--card-2);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow-card);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 90vw;
  border-left: 4px solid var(--primary);
  animation: toastIn 0.25s ease both;
  overflow: hidden;
  position: relative;
}
.toast.toast-error { border-left-color: var(--critical); }
.toast.toast-info { border-left-color: var(--accent); }
.toast-progress { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--primary); animation: toastProgress 4s linear forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastProgress { from { width: 100%; } to { width: 0%; } }

/* ===== Empty states ===== */
.empty-state { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty-state svg { width: 96px; height: 96px; margin-bottom: 12px; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.empty-state h3 { color: var(--text); margin: 0 0 6px; }

/* ===== Parceiros ===== */
.partner-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}
.partner-card.premium { border: 1px solid #FBBF24; box-shadow: 0 0 0 1px rgba(251,191,36,0.4), var(--shadow-card); }
.partner-logo {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--card-2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.2rem; color: var(--primary);
  flex-shrink: 0; object-fit: cover;
}
.partner-type-badge { font-size: 0.7rem; padding: 3px 9px; border-radius: var(--radius-chip); font-weight: 700; color: #fff; display: inline-block; margin-bottom: 4px; }
.partner-type-badge.type-clinic { background: var(--primary); }
.partner-type-badge.type-petshop { background: #3B82F6; }
.partner-type-badge.type-grooming { background: var(--accent); }
.partner-type-badge.type-other { background: var(--muted); }
.partner-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.partner-tag { font-size: 0.72rem; background: var(--card-2); color: var(--muted); padding: 3px 9px; border-radius: var(--radius-chip); }
.partner-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.partner-actions a { font-size: 0.78rem; padding: 6px 12px; border-radius: var(--radius-chip); background: var(--card-2); color: var(--text); text-decoration: none; font-weight: 600; }
.partner-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--card-2); border-radius: var(--radius-btn);
  padding: 10px 14px; margin-top: 16px; text-decoration: none; color: var(--text);
}
.partner-banner .partner-banner-label { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.partner-filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.partner-filters a { flex-shrink: 0; padding: 7px 14px; border-radius: var(--radius-chip); background: var(--card-2); color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.85rem; }
.partner-filters a.active { background: var(--primary); color: #fff; }

/* ===== Feedback de análise (thumbs animados) ===== */
.feedback-form { display: flex; gap: 12px; margin-top: 8px; }
.feedback-btn {
  font-size: 1.5rem;
  background: var(--card-2);
  border: none;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.feedback-btn:active:not(:disabled) { animation: feedbackPop 0.4s ease; }
.feedback-btn:disabled { background: rgba(29,185,84,0.2); opacity: 1; }
@keyframes feedbackPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.5); }
  100% { transform: scale(1); }
}

/* Linha de botões: lado a lado ocupando toda a largura; se houver só um, fica centralizado */
.btn-row { display: flex; gap: 10px; width: 100%; margin-top: 8px; }
.btn-row .btn { flex: 1; text-align: center; }
.btn-row:has(.btn:only-child) { justify-content: center; }
.btn-row:has(.btn:only-child) .btn { flex: 0 0 auto; min-width: 200px; }

/* Botão de destaque para a funcionalidade principal: ver análise gerada por IA */
.btn-ai {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--secondary), #1ea89b);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 24px;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(46, 196, 182, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-ai:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(46, 196, 182, 0.45); }

.alert { padding: 12px 16px; border-radius: var(--radius-input); margin-bottom: 16px; }
.alert-success { background: rgba(29,185,84,0.15); color: #6FE39A; }
.alert-error { background: rgba(239,68,68,0.15); color: #FF9B9B; }
.alert-info { background: rgba(124,58,237,0.15); color: #C9A8FF; }

.badge { display: inline-block; padding: 4px 10px; border-radius: var(--radius-chip); font-size: 0.8rem; font-weight: 600; color: #fff; }
.badge-info { background: var(--primary); }
.badge-attention { background: var(--attention); color: #3a2a00; }
.badge-urgent { background: var(--urgent); }
.badge-critical { background: var(--critical); }

/* Caixa de sinalização da avaliação geral, colorida por nível de urgência */
.analysis-summary { padding: 14px 16px; border-radius: var(--radius-input); margin: 12px 0; font-weight: 500; border-left: 5px solid; background: var(--card-2); }
.analysis-summary.level-info { color: #6FE39A; border-color: var(--primary); }
.analysis-summary.level-attention { color: #FBBF24; border-color: var(--attention); }
.analysis-summary.level-urgent { color: #FF9B6B; border-color: var(--urgent); }
.analysis-summary.level-critical { color: #FF9B9B; border-color: var(--critical); animation: criticalPulse 1.6s ease-in-out infinite; }
@keyframes criticalPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); } 50% { box-shadow: 0 0 0 6px rgba(239,68,68,0.08); } }

/* Itens de alerta individuais, como chips coloridos por severidade */
.alert-item { display: inline-flex; align-items: center; padding: 6px 12px; margin: 4px 6px 4px 0; border-radius: var(--radius-chip); font-weight: 600; font-size: 0.82rem; background: var(--card-2); }
.alert-item.level-info { color: #6FE39A; }
.alert-item.level-attention { color: #FBBF24; }
.alert-item.level-urgent { color: #FF9B6B; }
.alert-item.level-critical { color: #FF9B9B; }

.timeline-item { border-left: 3px solid var(--primary); padding: 10px 16px; margin-bottom: 14px; }
.timeline-date { font-size: 0.85rem; color: var(--muted); }

.history-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.month-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 14px 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--card-2);
}
.month-filter-label { font-weight: 700; font-size: 0.92rem; min-width: 90px; text-align: center; }
.month-filter-nav {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--card-2);
  color: var(--text);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 700;
}
.month-filter-nav:hover { background: var(--primary); }
.history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.btn-history {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.82rem;
  padding: 7px 12px;
}

/* Modal genérico */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
.modal-overlay.modal-open { display: flex; }
.modal-box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-card);
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
}
.modal-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.modal-options .btn { width: 100%; text-align: center; }

.footer { text-align: center; color: var(--muted); padding: 10px 20px 20px; font-size: 0.78rem; opacity: 0.7; }

.free-badge {
  margin-top: 14px;
  color: var(--text);
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
}

.flex-between { display: flex; align-items: center; justify-content: space-between; }
.muted { color: var(--muted); }
.photo-thumb { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; margin-right: 8px; }

.pet-avatar {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--primary);
  flex-shrink: 0;
}
.pet-avatar-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: var(--card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.pet-card-header { display: flex; align-items: center; gap: 12px; }
.log-timestamp { font-size: 0.85rem; color: var(--muted); }

/* ===== Status do dia (mini-chips) ===== */
.status-chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; }
.status-chip { display: flex; align-items: center; gap: 8px; background: var(--card-2); border-radius: var(--radius-btn); padding: 10px 12px; font-size: 0.82rem; font-weight: 600; }
.status-chip .status-chip-icon { font-size: 1.1rem; }

/* ===== Status v2 (ícone + label pequeno + valor) ===== */
.section-label { font-size: 0.72rem; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; text-transform: uppercase; margin: 18px 0 8px; display: flex; align-items: center; gap: 6px; }
.status-grid-v2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.status-cell {
  background: var(--card-2);
  border-radius: var(--radius-btn);
  padding: 10px 12px;
}
.status-cell-label { display: flex; align-items: center; gap: 6px; font-size: 0.74rem; color: var(--muted); margin-bottom: 4px; }
.status-cell-value { font-weight: 700; font-size: 0.92rem; }
.status-cell-value.tone-ok { color: var(--primary); }
.status-cell-value.tone-warn { color: var(--attention); }
.status-cell-value.tone-alert { color: var(--critical); }
.status-cell-value.tone-info { color: #3B82F6; }

.hero-badge-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(29,185,84,0.15); color: var(--primary);
  font-size: 0.72rem; font-weight: 700;
  padding: 3px 10px; border-radius: var(--radius-chip);
  margin-top: 4px;
}
.hero-deco {
  position: absolute; top: -20px; right: -20px;
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(29,185,84,0.18), transparent 70%);
  pointer-events: none;
}

/* ===== Próximos cuidados (carrossel) ===== */
.care-card {
  width: 140px;
  background: var(--card-2);
  border-radius: var(--radius-btn);
  padding: 12px;
  border-left: 4px solid var(--primary);
}
.care-card.tone-danger { border-left-color: var(--critical); }
.care-card.tone-info { border-left-color: #3B82F6; }
.care-card.tone-warn { border-left-color: var(--attention); }
.care-card-icon { font-size: 1.2rem; margin-bottom: 6px; display: block; }
.care-card h4 { margin: 0 0 2px; font-size: 0.85rem; }
.care-card p { margin: 0; font-size: 0.72rem; color: var(--muted); }
.care-card .care-status { font-size: 0.72rem; font-weight: 700; margin-top: 6px; display: block; }
.care-status.tone-danger { color: #FF9B9B; }
.care-status.tone-info { color: #93C5FD; }
.care-status.tone-warn { color: var(--attention); }

/* ===== Parceiro - card largo (dashboard) ===== */
.partner-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card-2); border-radius: var(--radius-btn);
  padding: 12px; margin-bottom: 10px; position: relative;
}
.partner-row-logo {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  background: var(--card); display: flex; align-items: center; justify-content: center;
  font-size: 0.62rem; font-weight: 800; color: var(--primary); text-align: center; line-height: 1.1;
}
.partner-row-body { flex: 1; min-width: 0; }
.partner-row-body h4 { margin: 0 0 2px; font-size: 0.88rem; }
.partner-row-body p { margin: 0 0 6px; font-size: 0.76rem; color: var(--muted); }
.partner-row-badge {
  position: absolute; top: 10px; right: 10px;
  background: #FBBF24; color: #3a2a00; font-size: 0.65rem; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-chip);
}
.partner-row-badge.type-clinic { background: var(--primary); color: #fff; }
.partner-row-badge.type-petshop { background: #3B82F6; color: #fff; }
.partner-row-badge.type-grooming { background: var(--accent); color: #fff; }
.partner-row-badge.type-other { background: var(--muted); color: #fff; }
.partner-row-actions { display: flex; gap: 6px; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.72rem; font-weight: 700; padding: 5px 10px;
  border-radius: var(--radius-chip); text-decoration: none; border: none; cursor: pointer;
}
.pill-btn-wa { background: rgba(29,185,84,0.18); color: var(--primary); }
.pill-btn-outline { background: transparent; border: 1px solid var(--card-2); color: var(--text); }

/* ===== Alertas e recomendações (análise IA) ===== */
.alert-card {
  background: var(--card-2);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-btn);
  padding: 10px 14px;
  margin-bottom: 8px;
}
.alert-card p { margin: 4px 0 0; font-size: 0.82rem; color: var(--muted); line-height: 1.5; }
.rec-list { margin: 0 0 8px; padding-left: 18px; }
.rec-list li { margin-bottom: 8px; line-height: 1.6; font-size: 0.9rem; }

/* ===== Perfil do pet ===== */
.pet-profile-card { text-align: center; }
.pet-profile-avatar { width: 72px; height: 72px; margin: 0 auto; }

.energy-bars { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; height: 70px; }
.energy-bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; flex: 1; height: 100%; }
.energy-bar { width: 100%; max-width: 26px; border-radius: 6px 6px 2px 2px; transition: height 0.3s ease; }
.energy-bar-col span { font-size: 0.65rem; color: var(--muted); }

.health-event { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--card-2); }
.health-event:last-child { border-bottom: none; }
.health-event-icon { font-size: 1.1rem; flex-shrink: 0; }

.analysis-scroll-list {
  max-height: 168px;
  overflow-y: auto;
  padding-right: 4px;
}
.analysis-scroll-list::-webkit-scrollbar { width: 6px; }
.analysis-scroll-list::-webkit-scrollbar-thumb { background: var(--card-2); border-radius: 999px; }
.analysis-scroll-list .btn:first-child { margin-top: 0 !important; }

.health-type-chip {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--card-2);
  padding: 1px 7px;
  border-radius: var(--radius-chip);
  vertical-align: middle;
}

.usage-limit { text-align: left; }
.usage-limit-label { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.usage-limit .progress-bar { margin-bottom: 0; }

/* ===== Carrossel horizontal ===== */
.hscroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scroll-behavior: smooth;
}
.hscroll > * { scroll-snap-align: start; flex-shrink: 0; }

/* ===== Pet card horizontal (lista) ===== */
.pet-card-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px; text-decoration: none; color: var(--text);
  box-shadow: var(--shadow-card);
}
.pet-card-row .pet-card-row-body { flex: 1; min-width: 0; }
.pet-card-row .pet-card-row-body h3 { margin: 0 0 2px; font-size: 1rem; }
.pet-card-row .chevron { color: var(--muted); flex-shrink: 0; }
.status-ring-ok { box-shadow: 0 0 0 2px var(--primary); }
.status-ring-warn { box-shadow: 0 0 0 2px var(--attention); }
.status-ring-alert { box-shadow: 0 0 0 2px var(--critical); }
.days-no-log { font-size: 0.72rem; background: rgba(239,68,68,0.15); color: #FF9B9B; padding: 2px 8px; border-radius: var(--radius-chip); font-weight: 700; }
