:root {
  --bg:     #FDF6F0;
  --card:   #FFFFFF;
  --teal:   #2E8B84;
  --teal-l: #E8F5F4;
  --gold:   #C8963E;
  --gold-l: #FEF4E3;
  --rose:   #D4647A;
  --rose-l: #FDE8EC;
  --ink:    #2C2C2C;
  --muted:  #8A8A8A;
  --border: #EDE8E3;
  --radius: 16px;
  --radius-sm: 10px;
}

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

html, body {
  background: var(--bg);
  font-family: 'Nunito', sans-serif;
  color: var(--ink);
}

a { text-decoration: none; color: inherit; }

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 88px;
}

.status-spacer { height: 0; }

.screen { padding-bottom: 20px; }

/* ── Page header ── */
.page-header { padding: 20px 20px 12px; }
.page-header h1 { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.page-header .sub { font-size: 13px; color: var(--muted); margin-top: 2px; font-weight: 500; }

/* ── Search bar ── */
.search-wrap { padding: 0 20px 16px; }
.search-bar {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 11px 16px;
  width: 100%;
  font-size: 14px;
  font-family: 'Nunito', sans-serif;
  font-weight: 500;
  color: var(--ink);
}
.search-bar::placeholder { color: var(--muted); }

/* ── Section label ── */
.section-label {
  padding: 0 20px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}

/* ── Alert banner ── */
.alert-banner {
  margin: 0 20px 16px;
  background: var(--gold-l);
  border: 1.5px solid #F0C87A;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-banner .icon { font-size: 20px; }
.alert-banner .text { font-size: 13px; font-weight: 600; color: #7A5A1A; line-height: 1.4; }
.alert-banner .text span { font-weight: 800; }
.alert-banner.rose { background: var(--rose-l); border-color: #EBB3C0; }
.alert-banner.rose .text { color: #8A3345; }

/* ── Pet card ── */
.pet-card {
  margin: 0 20px 10px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1.5px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.pet-avatar {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; flex-shrink: 0; color: white;
}
.pet-info { flex: 1; min-width: 0; }
.pet-name { font-size: 16px; font-weight: 700; color: var(--ink); }
.pet-meta { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.pet-owner { font-size: 12px; color: var(--teal); font-weight: 600; margin-top: 2px; }
.pet-flags { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.flag { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.flag.warn { background: var(--gold-l); color: #7A5A1A; }
.flag.safe { background: var(--teal-l); color: #1A5A56; }
.pet-chevron { color: var(--border); font-size: 18px; font-weight: 700; flex-shrink: 0; }

/* ── FAB ── */
.fab {
  position: fixed;
  bottom: 88px;
  right: max(20px, calc((100vw - 480px) / 2 + 20px));
  width: 52px; height: 52px;
  background: var(--teal);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: white; font-weight: 300; line-height: 1;
  box-shadow: 0 4px 16px rgba(46,139,132,0.4);
  z-index: 20;
}

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 72px;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px 8px;
  z-index: 10;
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; padding: 6px 0; }
.nav-icon { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.nav-item.active .nav-icon { background: var(--teal-l); }
.nav-label { font-size: 10px; font-weight: 600; color: var(--muted); }
.nav-item.active .nav-label { color: var(--teal); }

/* ── Profile hero ── */
.profile-hero { background: linear-gradient(160deg, #E8F5F4 0%, var(--bg) 60%); padding: 20px 20px 24px; }
.back-btn { font-size: 13px; font-weight: 700; color: var(--teal); display: flex; align-items: center; gap: 4px; margin-bottom: 16px; }
.profile-header { display: flex; align-items: flex-start; gap: 16px; }
.profile-avatar {
  width: 72px; height: 72px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800; color: white; flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.profile-name { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.profile-breed { font-size: 14px; color: var(--muted); font-weight: 500; margin-top: 3px; }
.profile-owner { font-size: 13px; color: var(--teal); font-weight: 700; margin-top: 4px; }

/* ── Behavioral alert ── */
.behavior-alert { margin: 0 20px 14px; background: var(--gold-l); border: 2px solid var(--gold); border-radius: var(--radius-sm); padding: 14px 16px; }
.behavior-alert-header { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.7px; color: var(--gold); margin-bottom: 6px; }
.behavior-alert ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.behavior-alert li { font-size: 13px; font-weight: 600; color: #6B4A10; display: flex; align-items: flex-start; gap: 6px; }

/* ── Info grid ── */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 20px 14px; }
.info-cell { background: var(--card); border-radius: var(--radius-sm); padding: 12px 14px; border: 1.5px solid var(--border); }
.info-cell-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin-bottom: 3px; }
.info-cell-value { font-size: 15px; font-weight: 700; color: var(--ink); }

/* ── Section card ── */
.section-card { margin: 0 20px 14px; background: var(--card); border-radius: var(--radius); border: 1.5px solid var(--border); overflow: hidden; }
.section-card-header {
  padding: 14px 16px 10px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; color: var(--ink);
  border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center;
}
.section-card-add { font-size: 13px; font-weight: 700; color: var(--teal); }
.section-card-empty { padding: 16px; font-size: 13px; color: var(--muted); font-weight: 500; text-align: center; }

.visit-row { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.visit-row:last-child { border-bottom: none; }
.visit-date { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.visit-service { font-size: 14px; font-weight: 700; color: var(--ink); }
.visit-note { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }

.vacc-row { padding: 10px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.vacc-row:last-child { border-bottom: none; }
.vacc-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.vacc-date { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.vacc-date.ok { background: var(--teal-l); color: #1A5A56; }
.vacc-date.warn { background: var(--gold-l); color: #7A5A1A; }
.vacc-date.expired { background: var(--rose-l); color: #8A3345; }

/* ── Forms ── */
.form-page { padding: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted); margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 500;
  color: var(--ink); background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--teal);
}
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }

.btn {
  display: inline-block; width: 100%; text-align: center;
  font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 700;
  padding: 13px 18px; border-radius: var(--radius-sm); border: none; cursor: pointer;
}
.btn-primary { background: var(--teal); color: white; }
.btn-secondary { background: var(--card); color: var(--ink); border: 1.5px solid var(--border); }
.btn-danger { background: var(--rose-l); color: #8A3345; }

.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin-bottom: 0; text-transform: none; font-size: 14px; font-weight: 600; color: var(--ink); }
