/* ============================================================
   ZooCare Pro — Tablet-First Modern Zoo Operations Stylesheet
   ============================================================ */

:root {
  --bg: #f3f5f1;
  --surface: #ffffff;
  --surface-alt: #f8faf6;
  --border: #dfe5dc;
  --border-strong: #c8d3c4;
  --text: #18231c;
  --text-muted: #55665b;
  --primary: #166534;
  --primary-hover: #14532d;
  --primary-soft: #dcfce7;
  --primary-soft-text: #14532d;
  --sidebar-bg: #0f291c;
  --sidebar-text: #d7e5dc;
  --sidebar-muted: #88a996;
  --sidebar-active: #1f5c3a;
  --info: #0369a1;
  --info-soft: #e0f2fe;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --danger: #be123c;
  --danger-soft: #ffe4e6;
  --success: #15803d;
  --success-soft: #dcfce7;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(15, 41, 28, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 41, 28, 0.12);
  --sidebar-w: 256px;
  --topbar-h: 64px;
  --bottomnav-h: 72px;
}

[data-theme="dark"] {
  --bg: #0b1410;
  --surface: #122019;
  --surface-alt: #182a21;
  --border: #253d31;
  --border-strong: #325242;
  --text: #e6f0ea;
  --text-muted: #96b2a2;
  --primary: #22c55e;
  --primary-hover: #16a34a;
  --primary-soft: #143623;
  --primary-soft-text: #86efac;
  --sidebar-bg: #07110c;
  --sidebar-active: #17492c;
  --info: #38bdf8;
  --info-soft: #0c2e42;
  --warning: #fbbf24;
  --warning-soft: #3a2709;
  --danger: #fb7185;
  --danger-soft: #3f111c;
  --success: #4ade80;
  --success-soft: #123621;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] select.form-control,
[data-theme="dark"] textarea.form-control,
[data-theme="dark"] .toggle-option label,
[data-theme="dark"] .care-log-note {
  background: #0d1913;
  color: var(--text);
}

[data-theme="dark"] .btn-primary {
  color: #052010;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ---------------- Layout Shell ---------------- */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.brand-text strong {
  display: block;
  font-size: 16px;
  color: #fff;
  line-height: 1.2;
}

.brand-text span {
  font-size: 12px;
  color: var(--sidebar-muted);
}

.sidebar-nav {
  flex: 1;
  padding: 14px 12px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-muted);
  padding: 12px 12px 6px;
  font-weight: 700;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 11px;
  color: var(--sidebar-text);
  font-weight: 500;
  font-size: 15px;
  margin-bottom: 4px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
  color: #fff;
}

.nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.nav-link .nav-icon {
  font-size: 19px;
  width: 24px;
  text-align: center;
}

.nav-badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #22c55e;
  color: #082012;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-chip-info strong {
  display: block;
  font-size: 14px;
  color: #fff;
  line-height: 1.2;
}

.user-chip-info span {
  font-size: 12px;
  color: var(--sidebar-muted);
  text-transform: capitalize;
}

.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.menu-toggle {
  display: none;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 44px;
  height: 44px;
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.content {
  padding: 24px;
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(9, 25, 16, 0.55);
  z-index: 35;
}

/* Tablet/Mobile Bottom Nav */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--bottomnav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 18px rgba(15, 41, 28, 0.08);
  z-index: 32;
  padding: 6px 8px env(safe-area-inset-bottom);
}

.bottom-nav-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
}

.bottom-nav-item:hover { text-decoration: none; }

.bottom-nav-item .bn-icon { font-size: 21px; line-height: 1; }

.bottom-nav-item.active {
  color: var(--primary);
  background: var(--primary-soft);
}

/* ---------------- Cards & Grids ---------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.card-subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon.green { background: var(--primary-soft); color: var(--primary); }
.stat-icon.blue  { background: var(--info-soft); color: var(--info); }
.stat-icon.amber { background: var(--warning-soft); color: var(--warning); }
.stat-icon.red   { background: var(--danger-soft); color: var(--danger); }

.stat-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

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

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

/* ---------------- Animal Cards (Tablet Touch-Friendly) ---------------- */

.animal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  color: inherit;
  text-decoration: none;
}

.animal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  text-decoration: none;
}

.animal-card-photo {
  height: 180px;
  background: linear-gradient(135deg, #e7efe4, #d6e6d1);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.animal-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.animal-photo-placeholder {
  font-size: 56px;
  opacity: 0.65;
}

.animal-id-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 41, 28, 0.85);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.animal-status-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.animal-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.animal-card-name {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
  color: var(--text);
}

.animal-card-species {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.animal-card-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.08s ease, border-color 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }
.btn:hover { text-decoration: none; }

.btn-lg { min-height: 52px; padding: 12px 24px; font-size: 16px; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); color: #fff; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-alt); }

.btn-info {
  background: var(--info);
  color: #fff;
}
.btn-info:hover { background: #075985; color: #fff; }

.btn-warning {
  background: #d97706;
  color: #fff;
}
.btn-warning:hover { background: #b45309; color: #fff; }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #9f1239; color: #fff; }

.btn-soft-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #fecdd3;
}
.btn-soft-danger:hover { background: #fecdd3; }

.btn-ghost {
  background: transparent;
  color: var(--sidebar-text);
  border-color: rgba(255, 255, 255, 0.18);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

/* ---------------- Forms & Tablet Care Toggles ---------------- */

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

.form-group {
  margin-bottom: 16px;
}

.form-group.full { grid-column: 1 / -1; }

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-control, select.form-control, textarea.form-control {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 16px; /* Prevents iOS/iPadOS zoom on focus */
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.15);
}

/* Big Touch Toggle Groups for Daily Care */
.care-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.care-check-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.care-check-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle-option {
  flex: 1;
  min-width: 100px;
  position: relative;
}

.toggle-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 50px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  user-select: none;
}

.toggle-option input[type="radio"]:checked + label.opt-green {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(22, 101, 52, 0.25);
}

.toggle-option input[type="radio"]:checked + label.opt-red {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  box-shadow: 0 4px 10px rgba(190, 18, 60, 0.25);
}

.toggle-option input[type="radio"]:checked + label.opt-blue {
  background: var(--info);
  border-color: var(--info);
  color: #fff;
  box-shadow: 0 4px 10px rgba(3, 105, 161, 0.25);
}

.toggle-option input[type="radio"]:checked + label.opt-amber {
  background: #d97706;
  border-color: #d97706;
  color: #fff;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.25);
}

.toggle-option input[type="radio"]:checked + label.opt-slate {
  background: #475569;
  border-color: #475569;
  color: #fff;
}

/* ---------------- Badges & Alerts ---------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-info    { background: var(--info-soft); color: var(--info); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft); color: var(--danger); }
.badge-muted   { background: #e8ece7; color: #475569; }
.badge-dark    { background: #1e293b; color: #fff; }

.alert {
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
}

.alert-success { background: var(--success-soft); color: #14532d; border-color: #86efac; }
.alert-error   { background: var(--danger-soft); color: #881337; border-color: #fda4af; }
.alert-info    { background: var(--info-soft); color: #0c4a6e; border-color: #7dd3fc; }
.alert-warning { background: var(--warning-soft); color: #78350f; border-color: #fcd34d; }

/* ---------------- Tables ---------------- */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.data-table th {
  text-align: left;
  padding: 12px 14px;
  background: var(--surface-alt);
  border-bottom: 2px solid var(--border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

table.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.data-table tr:last-child td { border-bottom: none; }

/* ---------------- Animal Detail Header ---------------- */

.animal-hero {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
}

.animal-hero-photo {
  width: 148px;
  height: 148px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, #e7efe4, #d6e6d1);
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.animal-hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.animal-hero-info {
  flex: 1;
  min-width: 240px;
}

.animal-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------------- Care Timeline ---------------- */

.care-log-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px 16px;
  margin-bottom: 12px;
  background: var(--surface-alt);
}

.care-log-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.care-log-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.care-log-note {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 14px;
  white-space: pre-wrap;
}

/* ---------------- Task Cards ---------------- */

.task-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-item.completed {
  background: var(--surface-alt);
  opacity: 0.85;
}

.task-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------------- Toolbar / Filter Bar ---------------- */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.search-box {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.search-box .form-control {
  max-width: 300px;
}

/* ---------------- Auth / Installer Centered Layout ---------------- */

.centered-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(circle at top right, #dcfce7 0%, #f3f5f1 55%);
}

.centered-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 30px;
}

.centered-card.wide {
  max-width: 720px;
}

/* ---------------- Modal ---------------- */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 41, 28, 0.58);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--surface);
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-close {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  font-size: 20px;
  cursor: pointer;
}

/* ---------------- Helpers ---------------- */

.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mb-0 { margin-bottom: 0; }
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 42px; margin-bottom: 8px; }

/* ---------------- Responsive: Tablet Portrait & Mobile ---------------- */

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-backdrop.open {
    display: block;
  }
  .main-wrap {
    margin-left: 0;
    padding-bottom: calc(var(--bottomnav-h) + 12px);
  }
  .menu-toggle {
    display: inline-flex;
  }
  .bottom-nav {
    display: block;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .content {
    padding: 18px;
  }
}

@media (max-width: 640px) {
  .care-check-grid, .form-grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    padding: 0 14px;
  }
  .content {
    padding: 14px;
  }
  .animal-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .animal-hero-photo {
    width: 112px;
    height: 112px;
  }
  .search-box .form-control {
    max-width: none;
  }
}
