:root {
  --pink: #ec4899;
  --pink-light: #fce7f3;
  --pink-dark: #be185d;
  --purple: #a855f7;
  --purple-light: #f3e8ff;
  --warm: #fef7ed;
  --warm-dark: #fde68a;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-500: #737373;
  --gray-700: #404040;
  --gray-900: #171717;
  --radius: 16px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, #fdf2f8 0%, #faf5ff 50%, #fdf2f8 100%);
  background-attachment: fixed;
  color: var(--gray-900);
  line-height: 1.5;
  min-height: 100vh;
}

/* ─── Header ──────────────────────────────────── */
.header {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(236,72,153,0.1);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 0.75rem; }
.header-icon { font-size: 1.5rem; }
.header-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pink-dark);
}
.header-sub { font-size: 0.78rem; color: var(--gray-500); }
.header-nav { display: flex; gap: 0.5rem; }
.header-nav a {
  text-decoration: none;
  color: var(--gray-500);
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  transition: all 0.15s;
}
.header-nav a:hover { background: var(--pink-light); color: var(--pink-dark); }
.header-nav a.active { background: var(--pink); color: #fff; }

/* ─── Main ────────────────────────────────────── */
.main { max-width: 700px; margin: 0 auto; padding: 1rem; }

/* ─── Landing ─────────────────────────────────── */
.landing-hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
}
.landing-hero .icon { font-size: 4rem; margin-bottom: 0.5rem; }
.landing-hero h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--pink-dark);
  margin-bottom: 0.25rem;
}
.landing-hero p { color: var(--gray-500); font-size: 0.95rem; }

.child-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.child-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  border: 2px solid transparent;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.child-card:hover { border-color: var(--pink); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(236,72,153,0.12); }
.child-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--pink-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  overflow: hidden;
  flex-shrink: 0;
}
.child-avatar img { width: 100%; height: 100%; object-fit: cover; }
.child-info h3 { font-size: 1.05rem; font-weight: 700; color: var(--gray-900); }
.child-info .meta { font-size: 0.82rem; color: var(--gray-500); }
.child-info .count { font-size: 0.78rem; color: var(--pink); font-weight: 600; }

/* ─── Cards ───────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--pink-dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ─── Form ────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: 0.3rem;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(236,72,153,0.1);
}
.form-group textarea { resize: vertical; min-height: 100px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.kat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.kat-option {
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
  border: 1.5px solid var(--gray-200);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}
.kat-option:hover { border-color: var(--pink); }
.kat-option input { display: none; }
.kat-option.selected { background: var(--pink); color: #fff; border-color: var(--pink); }

.file-input-wrap {
  border: 2px dashed var(--gray-300);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--gray-500);
}
.file-input-wrap:hover { border-color: var(--pink); color: var(--pink); }
.file-input-wrap input { display: none; }
.file-input-wrap .icon { font-size: 2rem; margin-bottom: 0.25rem; }

/* ─── Buttons ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 1.2rem; border: none; border-radius: 12px;
  font-size: 0.9rem; font-family: inherit; cursor: pointer;
  text-decoration: none; transition: all 0.15s; font-weight: 600;
}
.btn-pink { background: var(--pink); color: #fff; }
.btn-pink:hover { background: var(--pink-dark); }
.btn-outline { background: #fff; border: 1.5px solid var(--gray-200); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--pink); color: var(--pink); }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.82rem; }
.btn-lg { padding: 0.75rem 2rem; font-size: 1rem; }

/* ─── Timeline ────────────────────────────────── */
.timeline { position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--pink), var(--purple), var(--pink));
  opacity: 0.2;
}
.timeline-item {
  position: relative;
  padding-left: 56px;
  margin-bottom: 1.5rem;
}
.timeline-dot {
  position: absolute;
  left: 14px;
  top: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--pink);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem;
  z-index: 1;
}
.timeline-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid rgba(236,72,153,0.08);
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.timeline-card:hover { box-shadow: 0 8px 24px rgba(236,72,153,0.1); transform: translateY(-1px); }
.timeline-date {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.timeline-date .age { color: var(--pink); font-weight: 600; }
.timeline-kat {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--pink-light);
  color: var(--pink-dark);
}
.timeline-text {
  font-size: 0.95rem;
  margin: 0.5rem 0;
  line-height: 1.6;
}
.timeline-media {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.timeline-thumb {
  width: 80px; height: 80px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--gray-200);
}
.timeline-audio { margin-top: 0.5rem; }
.timeline-audio audio { width: 100%; height: 40px; border-radius: 8px; }

/* ─── Filter ──────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  align-items: center;
}
.filter-bar select {
  padding: 0.4rem 0.7rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  background: #fff;
}
.filter-bar select:focus { border-color: var(--pink); }

/* ─── Detail ──────────────────────────────────── */
.detail-media img, .detail-media video {
  max-width: 100%;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}
.detail-media audio { width: 100%; margin-bottom: 0.75rem; }

/* ─── Empty state ─────────────────────────────── */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
}
.empty .icon { font-size: 3rem; margin-bottom: 0.5rem; }

/* ─── Footer ──────────────────────────────────── */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--gray-500);
  font-size: 0.78rem;
}
.footer a { color: var(--pink); text-decoration: none; }

/* ─── FAB ─────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  border: none;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(236,72,153,0.4);
  z-index: 90;
  transition: all 0.2s;
}
.fab:hover { transform: scale(1.1); background: var(--pink-dark); }

/* ─── Responsive ──────────────────────────────── */
@media (max-width: 600px) {
  .main { padding: 0.75rem; }
  .form-row { grid-template-columns: 1fr; }
  .landing-hero h1 { font-size: 1.4rem; }
  .child-grid { grid-template-columns: 1fr; }
}
