/* === Baby Growth Journal - Warm Professional Theme === */

:root {
  --primary: #FF7B6B;
  --primary-dark: #E86850;
  --primary-light: #FFE8E3;
  --bg: #FFF5F3;
  --bg-warm: #FFFAF8;
  --card: #FFFFFF;
  --text: #4A3728;
  --text-secondary: #8B7E74;
  --text-muted: #B8A99A;
  --border: #F0E4DC;
  --border-light: #F8F0EB;
  --success: #7ECB76;
  --success-light: #EDF9EB;
  --warning: #FFB347;
  --warning-light: #FFF5E6;
  --danger: #E86850;
  --danger-light: #FFE8E3;
  --info: #7EB8DA;
  --info-light: #EAF4FA;
  --shadow-sm: 0 1px 3px rgba(74, 55, 40, 0.06);
  --shadow: 0 2px 8px rgba(74, 55, 40, 0.08);
  --shadow-lg: 0 4px 16px rgba(74, 55, 40, 0.1);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --nav-height: 64px;
  --header-height: 56px;
  --max-width: 640px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  outline: none;
  color: var(--text);
  background: var(--card);
  transition: border-color 0.2s;
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* === App Shell === */
#app {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-warm);
  position: relative;
  box-shadow: var(--shadow-lg);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
}

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

.app-logo { font-size: 28px; line-height: 1; }

.app-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}

.baby-age {
  font-size: 0.8rem;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 500;
}

/* === Main Content === */
.app-main {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  padding-bottom: calc(var(--nav-height) + 20px);
  -webkit-overflow-scrolling: touch;
}

/* === View Visibility === */
.view { display: block; }
.view.hidden { display: none; }

/* === Bottom Navigation === */
.bottom-nav {
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--border-light);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  padding-bottom: env(safe-area-inset-bottom, 0);
  max-width: var(--max-width);
  margin: 0 auto;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
  padding: 6px 0;
  position: relative;
}

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

.nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

.nav-icon { font-size: 22px; line-height: 1; }
.nav-label { font-size: 0.7rem; font-weight: 500; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover, .btn-primary:active {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
}

.btn-secondary:hover, .btn-secondary:active {
  background: #FFD5CC;
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-block { width: 100%; }

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
}

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.1rem;
}

/* === Card === */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

/* === Dashboard === */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.dashboard-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

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

.dashboard-card .card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.dashboard-card .card-icon {
  font-size: 24px;
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: var(--radius);
}

.dashboard-card .card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.dashboard-card .card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.dashboard-card .card-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Full-width featured card */
.dashboard-featured {
  grid-column: 1 / -1;
}

.dashboard-featured .card-header { margin-bottom: 6px; }
.dashboard-featured .card-value { font-size: 1.3rem; }

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s;
}

.quick-action-btn:active { transform: scale(0.95); }
.qa-icon { font-size: 26px; line-height: 1; }
.quick-action-btn span:last-child { font-size: 0.75rem; font-weight: 500; }

.dashboard-quick-actions h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-secondary);
}

/* === View Header === */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.view-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.view-header-actions {
  display: flex;
  gap: 8px;
}

/* === Timeline === */
.timeline-filters {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-input {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.tag-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tag-filters::-webkit-scrollbar { display: none; }

.tag-filter {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  background: var(--card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.tag-filter.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline-item {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  position: relative;
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-date::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
}

.timeline-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-content {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.timeline-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.timeline-tag {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--primary-light);
  color: var(--primary);
}

.timeline-media {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.timeline-media-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  object-fit: cover;
  cursor: pointer;
  border: 2px solid var(--border-light);
  transition: border-color 0.2s;
}

.timeline-media-thumb:hover {
  border-color: var(--primary);
}

.timeline-video-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid var(--border-light);
  font-size: 28px;
}

.timeline-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  justify-content: flex-end;
}

/* === Vaccine === */
.vaccine-status-bar {
  display: flex;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.status-item {
  flex: 1;
  text-align: center;
}

.status-count {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
}

.status-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.status-item:first-child .status-count { color: var(--success); }
.status-item:nth-child(2) .status-count { color: var(--info); }
.status-item:last-child .status-count { color: var(--danger); }

.vaccine-tabs, .exercise-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.vaccine-tabs::-webkit-scrollbar, .exercise-tabs::-webkit-scrollbar { display: none; }

.vax-tab, .ex-tab {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  background: var(--card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.vax-tab.active, .ex-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.vaccine-list, .feeding-list, .exercise-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vaccine-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--border);
  position: relative;
}

.vaccine-card.status-completed { border-left-color: var(--success); }
.vaccine-card.status-pending { border-left-color: var(--info); }
.vaccine-card.status-overdue { border-left-color: var(--danger); }

.vaccine-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.vaccine-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

.vaccine-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-completed { background: var(--success-light); color: var(--success); }
.badge-pending { background: var(--info-light); color: var(--info); }
.badge-overdue { background: var(--danger-light); color: var(--danger); }

.vaccine-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

/* === Feeding === */
.feeding-daily-stats {
  display: flex;
  background: linear-gradient(135deg, #FFF5F3, #FFE8E3);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  margin-bottom: 16px;
  gap: 0;
}

.daily-stat {
  flex: 1;
  text-align: center;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
}

.stat-unit {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-left: 2px;
}

.stat-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.feeding-item {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border-light);
}

.feeding-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 40px;
}

.feeding-details {
  flex: 1;
  min-width: 0;
}

.feeding-amount {
  font-size: 1.1rem;
  font-weight: 700;
}

.feeding-type {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: 6px;
}

.feeding-notes {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feeding-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
}

.badge-breast { background: #FDE8EC; color: #E86B8A; }
.badge-formula { background: #E3F0FD; color: #5B9BD5; }
.badge-mixed { background: #EDF2E8; color: #7BA05B; }

/* === Exercise === */
.exercise-streak-bar {
  background: linear-gradient(135deg, #FFF8E7, #FFE8C5);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.streak-info {
  font-size: 0.9rem;
  font-weight: 500;
}

.streak-flame {
  font-size: 1.2rem;
  margin-right: 4px;
}

.week-streak {
  display: flex;
  gap: 6px;
}

.streak-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--card);
  color: var(--text-muted);
  border: 2px solid var(--border);
}

.streak-dot.completed {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.streak-dot.missed {
  background: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger);
}

.exercise-item {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--border-light);
}

.exercise-check {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 2px;
}

.exercise-check.done {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.exercise-info { flex: 1; min-width: 0; }

.exercise-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.exercise-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.exercise-meta span { margin-right: 12px; }

.exercise-reaction {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-state p {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.empty-hint {
  font-size: 0.8rem !important;
  color: var(--text-muted);
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(74, 55, 40, 0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s;
}

.modal-overlay.hidden { display: none; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-container {
  background: var(--card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: var(--max-width);
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px 20px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
  animation: slideUp 0.3s ease-out;
  -webkit-overflow-scrolling: touch;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

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

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

.form-row {
  display: flex;
  gap: 10px;
}

.form-row > * { flex: 1; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.form-actions .btn { flex: 1; }

/* Tags input */
.tags-input-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  min-height: 40px;
  align-items: center;
  cursor: text;
}

.tags-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 14px;
  font-size: 0.75rem;
  font-weight: 500;
}

.tag-chip-remove {
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}

.tag-chip-remove:hover { opacity: 1; }

.tags-input {
  border: none !important;
  padding: 4px !important;
  min-width: 80px;
  flex: 1;
  outline: none;
  box-shadow: none !important;
}

.tags-input:focus {
  border: none !important;
  box-shadow: none !important;
}

/* File upload area */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg-warm);
}

.file-upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.file-upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.file-upload-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.file-preview-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.file-preview-item {
  position: relative;
  width: 70px; height: 70px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--border-light);
}

.file-preview-item img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.file-preview-item video {
  width: 100%; height: 100%;
  object-fit: cover;
}

.file-preview-remove {
  position: absolute;
  top: 2px; right: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}

/* === Media Viewer === */
.media-viewer {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-viewer.hidden { display: none; }

.media-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: white;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.media-content {
  max-width: 95vw;
  max-height: 90vh;
}

.media-content img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.media-content video {
  max-width: 95vw;
  max-height: 90vh;
  border-radius: var(--radius);
}

/* === Safety Notice === */
.safety-notice {
  background: #FFF8E7;
  border: 1px solid #FFE8A0;
  border-radius: var(--radius);
  padding: 14px;
  margin: 12px 0;
}

.safety-notice-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: #B8860B;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.safety-notice ul {
  list-style: none;
  padding: 0;
}

.safety-notice li {
  font-size: 0.78rem;
  color: #8B6914;
  padding: 3px 0;
  padding-left: 16px;
  position: relative;
}

.safety-notice li::before {
  content: '⚠';
  position: absolute;
  left: 0;
  font-size: 0.7rem;
}

/* === Exercise Check-in View === */
.checkin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkin-item {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.2s;
}

.checkin-item:active { background: var(--bg-warm); }

.checkin-check {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s;
}

.checkin-check.checked {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.checkin-info {
  flex: 1;
}

.checkin-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.checkin-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.checkin-meta {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Checkin summary */
.checkin-summary {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #EDF9EB, #D4F0CF);
  border-radius: var(--radius-lg);
  margin: 16px 0;
}

.checkin-summary .big-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--success);
  line-height: 1;
}

.checkin-summary .summary-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* === Responsive Desktop === */
@media (min-width: 768px) {
  #app {
    border-radius: var(--radius-xl);
    margin-top: 20px;
    margin-bottom: 20px;
    min-height: calc(100dvh - 40px);
  }

  .bottom-nav {
    position: sticky;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  }

  .dashboard-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .quick-actions-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .modal-overlay {
    align-items: center;
  }

  .modal-container {
    border-radius: var(--radius-xl);
    max-height: 80vh;
    max-width: 500px;
  }
}

/* === Utility === */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }

/* === Toggle Switch === */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-switch {
  position: relative;
  width: 48px; height: 26px;
  cursor: pointer;
}

.toggle-switch input { display: none; }

.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border);
  border-radius: 13px;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  left: 2px; top: 2px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--success);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* Custom exercise plan items */
.plan-item {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border-light);
}

.plan-item .plan-drag {
  color: var(--text-muted);
  cursor: grab;
  font-size: 1.2rem;
}

.plan-item .plan-info { flex: 1; }
.plan-item .plan-name { font-weight: 600; font-size: 0.9rem; }
.plan-item .plan-desc { font-size: 0.75rem; color: var(--text-secondary); }
.plan-item .plan-actions { display: flex; gap: 4px; }

/* Responsive week streak */
@media (max-width: 360px) {
  .streak-dot { width: 24px; height: 24px; font-size: 0.6rem; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
}

/* === Animations === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.1); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes celebrateShake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

@keyframes confettiFall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

@keyframes rainbowBg {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* Apply entrance animations to cards */
.dashboard-card {
  animation: fadeInUp 0.4s ease-out both;
}
.dashboard-card:nth-child(1) { animation-delay: 0.05s; }
.dashboard-card:nth-child(2) { animation-delay: 0.1s; }
.dashboard-card:nth-child(3) { animation-delay: 0.15s; }
.dashboard-card:nth-child(4) { animation-delay: 0.2s; }
.dashboard-card:nth-child(5) { animation-delay: 0.25s; }

.timeline-item {
  animation: fadeInUp 0.35s ease-out both;
}
.timeline-item:nth-child(odd) { animation-delay: 0.05s; }
.timeline-item:nth-child(even) { animation-delay: 0.1s; }

.vaccine-card, .feeding-item, .exercise-item {
  animation: fadeInUp 0.3s ease-out both;
}

/* === FAB (Floating Action Button) === */
.fab-container {
  position: fixed;
  bottom: calc(var(--nav-height) + 20px + env(safe-area-inset-bottom, 0px));
  right: 20px;
  z-index: 150;
}

.fab-main {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF7B6B, #FF5E7E);
  box-shadow: 0 4px 16px rgba(255, 123, 107, 0.45);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
  animation: pulse 2.5s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

.fab-main:hover, .fab-main:active {
  transform: scale(1.12);
  box-shadow: 0 6px 24px rgba(255, 123, 107, 0.55);
  animation: none;
}

.fab-main.open {
  transform: rotate(45deg);
  animation: none;
  background: linear-gradient(135deg, #4A3728, #666);
}

.fab-menu {
  position: absolute;
  bottom: 64px;
  right: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fab-menu.open {
  pointer-events: all;
  opacity: 1;
  transform: translateY(0);
}

.fab-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.fab-menu-item:hover, .fab-menu-item:active {
  transform: scale(1.04);
  box-shadow: var(--shadow-lg);
}

.fab-menu-icon { font-size: 20px; }
.fab-menu-label { font-size: 0.8rem; }

/* === Photo Gallery Grid === */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 12px 0;
}

.photo-gallery-item {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--bg);
  border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.2s;
}

.photo-gallery-item:hover {
  border-color: var(--primary);
  transform: scale(1.03);
}

.photo-gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.photo-gallery-item .play-overlay {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  pointer-events: none;
}

.photo-gallery-item .photo-date {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: white;
  font-size: 0.65rem;
  padding: 12px 4px 4px;
  text-align: center;
}

/* === Confetti === */
.confetti-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 400;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 3px;
  animation: confettiFall 2.5s ease-out forwards;
}

/* === Toast === */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 350;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 40px);
  max-width: 400px;
  pointer-events: none;
}

.toast {
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideDown 0.35s ease-out both;
  pointer-events: all;
}

.toast-success {
  border-left: 4px solid var(--success);
  color: #3A7D34;
}

.toast-info {
  border-left: 4px solid var(--info);
  color: #3A6D8A;
}

.toast-love {
  border-left: 4px solid var(--primary);
  color: var(--primary-dark);
  background: linear-gradient(135deg, #FFF, #FFF5F3);
}

/* === Media Viewer Enhanced === */
.media-viewer {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.92);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInScale 0.25s ease-out;
}

.media-viewer.hidden { display: none; }

.media-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  transition: background 0.2s;
}

.media-close:hover { background: rgba(255,255,255,0.3); }

.media-nav {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1;
}

.media-nav-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  transition: background 0.2s;
}

.media-nav-btn:hover { background: rgba(255,255,255,0.3); }

.media-counter {
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  font-weight: 500;
}

.media-content { max-width: 95vw; max-height: 80vh; }

.media-content img {
  max-width: 95vw; max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.media-content video {
  max-width: 95vw; max-height: 80vh;
  border-radius: var(--radius);
  outline: none;
}

/* === Quick Action Highlight === */
.quick-action-btn.highlight {
  background: linear-gradient(135deg, #FF7B6B, #FFB5A7);
  color: white;
  box-shadow: 0 3px 12px rgba(255, 123, 107, 0.3);
  position: relative;
  overflow: hidden;
}

.quick-action-btn.highlight::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.3) 50%, transparent 60%);
  animation: shimmer 2s infinite;
}

.quick-action-btn.highlight .qa-icon {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* === Check-in Complete Celebration === */
.checkin-complete {
  animation: celebrateShake 0.6s ease-in-out;
}

.checkin-summary.complete {
  background: linear-gradient(135deg, #DCFFDC, #A8F0A8, #FFE8B0);
  background-size: 200% 200%;
  animation: rainbowBg 3s ease infinite;
}

/* === Milestone Badge === */
.milestone-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 600;
  animation: popIn 0.4s ease-out both;
}

.badge-first-photo { background: #FEF3E2; color: #D4892A; }
.badge-first-step { background: #E8F5E9; color: #388E3C; }
.badge-streak-7 { background: #FFF3E0; color: #E65100; }
.badge-streak-30 { background: #FFEBEE; color: #C62828; }

/* === Dashboard Featured Enhance === */
.dashboard-featured .recent-photos {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
}

.dashboard-featured .recent-photos::-webkit-scrollbar { display: none; }

.recent-photo-item {
  flex-shrink: 0;
  width: 80px; height: 80px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.2s;
}

.recent-photo-item:hover { border-color: var(--primary); transform: scale(1.05); }
.recent-photo-item img { width: 100%; height: 100%; object-fit: cover; }
.recent-photo-item .video-icon-overlay {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px; pointer-events: none;
}

/* === Empty State Enhanced === */
.empty-state {
  animation: fadeInScale 0.5s ease-out;
}

.empty-icon {
  animation: float 3s ease-in-out infinite;
}

/* === Stats number animation === */
.stat-value, .card-value {
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}

/* === Card hover effects === */
.dashboard-card {
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
}

/* === View transition === */
.view {
  animation: fadeInUp 0.3s ease-out;
}

/* === Desktop enhancements === */
@media (min-width: 768px) {
  .fab-container {
    right: calc((100vw - var(--max-width)) / 2 + 20px);
    bottom: 28px;
  }

  .photo-gallery {
    grid-template-columns: repeat(4, 1fr);
  }

  .quick-actions-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}
