/* ကလေးမှတ်တမ်း — warm baby-friendly mobile-first theme */
:root {
  --bg: #fff8f1;
  --card: #ffffff;
  --ink: #3d2f2f;
  --muted: #9a8a80;
  --rose: #e8598b;
  --rose-bg: #fdeef3;
  --amber: #f0a04b;
  --amber-bg: #fdf3e3;
  --blue: #4f9cf0;
  --blue-bg: #e9f3fe;
  --green: #3fae6a;
  --green-bg: #e9f8ef;
  --line: #f0e4d8;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(180, 120, 80, 0.08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font-family: "Pyidaungsu", "Myanmar Text", "Noto Sans Myanmar", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 130px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.9rem; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #e8598b, #f0a04b);
  color: #fff;
  box-shadow: 0 2px 10px rgba(232, 89, 139, 0.3);
}
.brand { font-size: 1.15rem; font-weight: 700; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.icon-topbtn {
  background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.4);
  border-radius: 50%; width: 36px; height: 36px; font-size: 1.1rem; cursor: pointer; color: #fff;
}
.lang-toggle {
  background: rgba(255,255,255,0.2); color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 20px; padding: 5px 14px;
  font-size: 0.85rem; font-weight: 700; cursor: pointer;
}

main { max-width: 640px; margin: 0 auto; padding: 14px 14px 0; }
.view h2 { margin: 6px 0 12px; font-size: 1.25rem; }
.section-title { font-size: 1.05rem; margin: 18px 0 10px; }
.sub-head { margin: 18px 0 8px; font-size: 0.95rem; color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 10px; }
.link-btn { background: none; border: none; color: var(--rose); font-size: 0.9rem; cursor: pointer; font-weight: 700; font-family: inherit; }

.notice {
  background: var(--amber-bg); border: 2px dashed var(--amber);
  border-radius: var(--radius); padding: 18px; text-align: center; margin-bottom: 14px;
}
.notice-emoji { font-size: 2.5rem; }
.notice p { line-height: 1.8; margin: 8px 0 12px; }

.baby-card {
  display: flex; gap: 16px; align-items: center;
  background: var(--card); border-radius: 20px; padding: 18px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.baby-photo-wrap { position: relative; flex-shrink: 0; }
.baby-photo-wrap.center { display: flex; justify-content: center; margin-bottom: 6px; }
.baby-photo {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--rose-bg); box-shadow: var(--shadow);
}
.baby-photo-ph {
  width: 92px; height: 92px; border-radius: 50%;
  background: var(--rose-bg); display: flex; align-items: center; justify-content: center;
  font-size: 2.8rem; border: 4px dashed var(--line);
}
.baby-name { font-size: 1.4rem; font-weight: 800; }
.baby-age { font-size: 1.05rem; color: var(--rose); font-weight: 700; margin-top: 2px; }
.baby-birth { margin-top: 2px; }

.stat-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 14px 8px;
  box-shadow: var(--shadow); border: 1px solid var(--line); text-align: center;
}
.stat-emoji { font-size: 1.6rem; }
.stat-value { font-size: 1.3rem; font-weight: 800; margin: 4px 0 2px; color: var(--rose); }
.stat-title { font-size: 0.75rem; color: var(--muted); }

.quick-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 4px; border-radius: var(--radius); cursor: pointer;
  background: var(--card); border: 2px solid var(--line);
  font-family: inherit; font-size: 0.75rem; color: var(--ink); font-weight: 600;
  box-shadow: var(--shadow);
}
.quick-btn:active { transform: scale(0.95); border-color: var(--rose); }
.qe { font-size: 1.7rem; }

.log-list { display: flex; flex-direction: column; gap: 8px; }
.log-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: var(--radius);
  padding: 10px 12px; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.log-emoji {
  font-size: 1.5rem; width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border-radius: 12px;
}
.log-info { flex: 1; min-width: 0; }
.log-title { font-weight: 700; font-size: 0.95rem; }
.log-sub { font-size: 0.8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-time { font-size: 0.8rem; color: var(--muted); font-weight: 700; white-space: nowrap; }
.log-actions { display: flex; gap: 4px; }
.mini-btn { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 0.9rem; cursor: pointer; }
.live-badge {
  display: inline-block; background: var(--green-bg); color: var(--green);
  font-size: 0.72rem; font-weight: 800; border-radius: 8px; padding: 2px 8px; margin-left: 6px;
}
.end-btn {
  background: var(--green); color: #fff; border: none; border-radius: 10px;
  padding: 8px 12px; font-weight: 700; cursor: pointer; font-family: inherit; font-size: 0.85rem;
}

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-emoji { font-size: 3rem; margin-bottom: 8px; }
.empty p { line-height: 1.7; margin: 0; }

.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.month-label { font-size: 1.05rem; font-weight: 700; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card);
  font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink);
}
.day-summary {
  background: var(--rose-bg); border-radius: 12px; padding: 10px 14px;
  font-size: 0.9rem; margin-bottom: 12px; line-height: 1.7;
}

/* Forms */
.field-label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--muted); margin: 12px 0 6px; }
.text-input {
  width: 100%; padding: 11px 12px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--card);
  font-size: 1rem; color: var(--ink); font-family: inherit;
}
.text-input:focus { outline: none; border-color: var(--rose); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.seg-btn {
  padding: 11px 6px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--card); cursor: pointer; font-family: inherit;
  font-size: 0.9rem; color: var(--ink); font-weight: 600;
}
.seg-btn.selected { border-color: var(--rose); background: var(--rose-bg); color: var(--rose); font-weight: 800; }
.form-error { color: #c0392b; background: #fdecea; border-radius: 10px; padding: 10px; margin-top: 12px; font-size: 0.9rem; }
.primary-btn {
  width: 100%; margin-top: 18px; padding: 15px;
  background: linear-gradient(135deg, #e8598b, #f0a04b); color: #fff;
  border: none; border-radius: var(--radius); font-size: 1.05rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.primary-btn:active { transform: scale(0.98); }
.primary-btn.small { width: auto; margin-top: 0; padding: 9px 16px; font-size: 0.9rem; }
.ghost-btn {
  width: 100%; margin-top: 8px; padding: 12px;
  background: transparent; color: var(--muted);
  border: 1.5px solid var(--line); border-radius: var(--radius);
  font-size: 1rem; cursor: pointer; font-family: inherit;
}
.danger-btn {
  background: none; border: none; color: #c0392b; cursor: pointer;
  font-family: inherit; font-size: 0.85rem; padding: 6px; font-weight: 600;
}

/* Bottom sheet */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(60, 30, 30, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--bg); border-radius: 24px 24px 0 0;
  width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  animation: slideUp 0.22s ease-out;
}
@keyframes slideUp { from { transform: translateY(60px); opacity: 0.5; } to { transform: none; opacity: 1; } }
.sheet-handle { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 6px auto 10px; }
.sheet h3 { margin: 4px 0 6px; font-size: 1.15rem; }
.sheet-actions { display: flex; flex-direction: column; }
.type-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 8px 0; }

/* Vaccines */
.vac-item { align-items: flex-start; }
.vac-check {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  border: 2.5px solid var(--line); background: var(--card); cursor: pointer;
  font-size: 1rem; color: #fff; margin-top: 2px;
}
.vac-check.done { background: var(--green); border-color: var(--green); }
.vac-due { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.vac-due.overdue { color: #c0392b; font-weight: 700; }
.vac-due.duesoon { color: var(--amber); font-weight: 700; }
.vac-given { font-size: 0.78rem; color: var(--green); font-weight: 700; margin-top: 2px; }

/* Milestones */
.ms-photo { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.ms-star { font-size: 1.6rem; width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--amber-bg); border-radius: 12px; }
.ms-star.achieved { background: var(--green-bg); }
.ms-date { font-size: 0.8rem; color: var(--green); font-weight: 700; }
.ms-pending { font-size: 0.78rem; color: var(--muted); }

/* Charts */
.chart-card { background: var(--card); border-radius: var(--radius); padding: 14px 8px; box-shadow: var(--shadow); border: 1px solid var(--line); overflow-x: auto; }
.chart-card svg { display: block; margin: 0 auto; max-width: 100%; }
.chart-legend { display: flex; gap: 16px; justify-content: center; margin-top: 8px; font-size: 0.85rem; }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; }

/* FAB + bottom nav */
.fab {
  position: fixed; right: 18px; bottom: 92px; z-index: 20;
  width: 60px; height: 60px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, #e8598b, #f0a04b); color: #fff;
  font-size: 2rem; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 16px rgba(232, 89, 139, 0.45);
}
.fab:active { transform: scale(0.94); }
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; font-size: 1.25rem; cursor: pointer;
  color: var(--muted); font-family: inherit; padding: 4px;
}
.nav-btn span { font-size: 0.62rem; }
.nav-btn.active { color: var(--rose); font-weight: 700; }
