/* ── Root / Design tokens ──────────────────────────────────────────────── */
:root {
  --bb-green:       #2d9b5e;
  --bb-green-light: #e8f5ee;
  --bb-orange:      #f5923a;
  --bb-orange-light:#fff4ec;
  --bb-peach:       #fde8d8;
  --bb-cream:       #fffdf9;
  --bb-dark:        #1c2b20;
  --bb-muted:       #6b7e74;
  --bb-border:      #e4ede8;
  --bb-radius:      12px;
  --bb-radius-sm:   8px;
  --bb-shadow:      0 2px 12px rgba(45, 155, 94, 0.08);
  --bb-shadow-hover:0 4px 20px rgba(45, 155, 94, 0.15);
}

/* ── Base ──────────────────────────────────────────────────────────────── */
body {
  font-family: 'Nunito Sans', 'Nunito', system-ui, sans-serif;
  background: var(--bb-cream);
  color: var(--bb-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

h1, h2, h3, h4, h5, h6,
.fw-700, .fw-800 { font-family: 'Nunito', sans-serif; }
.fw-800 { font-weight: 800 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-600 { font-weight: 600 !important; }

/* ── Navbar ────────────────────────────────────────────────────────────── */
.bb-navbar {
  background: var(--bb-green);
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
.bb-navbar .navbar-brand { font-size: 1.35rem; letter-spacing: -0.5px; }
.bb-navbar .nav-link { color: rgba(255,255,255,0.85) !important; }
.bb-navbar .nav-link:hover,
.bb-navbar .nav-link.active { color: #fff !important; }
.bb-navbar .dropdown-menu { border-radius: var(--bb-radius-sm); border: 1px solid var(--bb-border); }

/* ── Footer ────────────────────────────────────────────────────────────── */
.bb-footer {
  background: #f0f7f3;
  border-top: 1px solid var(--bb-border);
}

/* ── Cards ─────────────────────────────────────────────────────────────── */
.bb-card {
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius);
  box-shadow: var(--bb-shadow);
  transition: box-shadow 0.2s;
}
.bb-card:hover { box-shadow: var(--bb-shadow-hover); }
.bb-card .card-header {
  background: #f5f9f6;
  border-bottom: 1px solid var(--bb-border);
  border-radius: var(--bb-radius) var(--bb-radius) 0 0 !important;
  font-size: 0.95rem;
}
.bb-card .card-footer {
  border-top: 1px solid var(--bb-border);
  border-radius: 0 0 var(--bb-radius) var(--bb-radius) !important;
}

/* ── Stat cards ─────────────────────────────────────────────────────────  */
.bb-stat-card {
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius);
  box-shadow: var(--bb-shadow);
}
.stat-number {
  font-family: 'Nunito', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}
.stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--bb-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* ── Baby avatar ───────────────────────────────────────────────────────── */
.baby-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--bb-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.baby-avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 1.75rem;
}

/* ── Hero icon ─────────────────────────────────────────────────────────── */
.bb-hero-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bb-green-light);
  color: var(--bb-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto;
}

/* ── Badges ────────────────────────────────────────────────────────────── */
.bb-stage-badge {
  background: var(--bb-green);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 20px;
  padding: 3px 10px;
}
.bb-allergen-badge {
  background: #fff3cd;
  color: #7c5c00;
  border: 1px solid #fde68a;
  font-size: 0.72rem;
  border-radius: 20px;
}
.bb-category-badge {
  background: var(--bb-green-light);
  color: var(--bb-green);
  font-size: 0.72rem;
  border-radius: 20px;
}

/* ── Alerts / banners ──────────────────────────────────────────────────── */
.bb-stage-alert {
  background: var(--bb-green-light);
  border: 1px solid #b7dfc8;
  color: var(--bb-green);
  border-radius: var(--bb-radius-sm);
}

/* ── Tables ────────────────────────────────────────────────────────────── */
.bb-table {
  border-radius: var(--bb-radius);
  overflow: hidden;
  font-size: 0.92rem;
}
.bb-table thead th {
  background: #f5f9f6;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bb-muted);
  border-bottom: 2px solid var(--bb-border);
}
.bb-table td { vertical-align: middle; }

/* ── Calendar ──────────────────────────────────────────────────────────── */
.bb-calendar {
  background: #fff;
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius);
  overflow: hidden;
  box-shadow: var(--bb-shadow);
}
.bb-cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bb-green);
}
.bb-cal-day-name {
  padding: 10px 0;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.bb-cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--bb-border);
}
.bb-cal-cell {
  border-right: 1px solid var(--bb-border);
  min-height: 80px;
  padding: 6px;
  position: relative;
}
.bb-cal-cell:last-child { border-right: none; }
.bb-cal-cell.bb-cal-empty { background: #fafafa; }
.bb-cal-cell.bb-cal-today { background: var(--bb-green-light); }

.bb-cal-day-link {
  text-decoration: none;
  color: var(--bb-dark);
  display: block;
  height: 100%;
}
.bb-cal-date {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.5;
}
.bb-cal-today .bb-cal-date {
  background: var(--bb-green);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
}
.bb-cal-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}
.bb-cal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.bb-dot-ok       { background: var(--bb-green); }
.bb-dot-allergen { background: #f59e0b; }
.bb-dot-warning  { background: #f97316; }
.bb-dot-danger   { background: #ef4444; }
.bb-cal-more {
  font-size: 0.65rem;
  color: var(--bb-muted);
  font-weight: 700;
}
.bb-cal-add {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: transparent;
  color: #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.bb-cal-cell:hover .bb-cal-add {
  background: var(--bb-green);
  color: #fff;
}

/* ── Allergen check / like radio ──────────────────────────────────────── */
.bb-allergen-check,
.bb-like-check {
  background: #f8faf9;
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.bb-allergen-check:has(.form-check-input:checked),
.bb-like-check:has(.form-check-input:checked) {
  border-color: var(--bb-green);
  background: var(--bb-green-light);
}

/* ── Allergen status grid ──────────────────────────────────────────────── */
.bb-allergen-status-card {
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-sm);
  padding: 12px;
  height: 100%;
}
.bb-allergen-status-card.status-introduced {
  border-color: #86efac;
  background: #f0fdf4;
}
.bb-allergen-status-card.status-pending {
  background: #fafafa;
}

/* ── Citation blocks ───────────────────────────────────────────────────── */
.cited-fact {
  background: #fff;
  border-left: 3px solid var(--bb-green);
  border-radius: 0 var(--bb-radius-sm) var(--bb-radius-sm) 0;
  padding: 12px 16px;
  margin-bottom: 14px;
  box-shadow: var(--bb-shadow);
}
.cited-warning {
  background: #fff8f0;
  border-left: 3px solid #f97316;
  border-radius: 0 var(--bb-radius-sm) var(--bb-radius-sm) 0;
  padding: 12px 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(249,115,22,0.07);
}
.citation-tag {
  display: block;
  font-size: 0.78rem;
  color: var(--bb-muted);
  margin-top: 6px;
  font-style: normal;
}
.citation-tag a {
  color: var(--bb-muted);
  text-decoration: none;
}
.citation-tag a:hover { text-decoration: underline; color: var(--bb-green); }

/* ── Sources box ───────────────────────────────────────────────────────── */
.bb-sources-box {
  background: #f5f9f6;
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-sm);
  padding: 16px 20px;
}

/* ── Content header ────────────────────────────────────────────────────── */
.bb-content-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--bb-border);
}

/* ── Steps (allergen intro) ────────────────────────────────────────────── */
.bb-step-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  background: #f8faf9;
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-sm);
  height: 100%;
}
.bb-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bb-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  flex-shrink: 0;
}

/* ── CTA box ───────────────────────────────────────────────────────────── */
.bb-cta-box {
  background: var(--bb-green-light);
  border: 1px solid #b7dfc8;
  border-radius: var(--bb-radius);
}

/* ── Resource links ────────────────────────────────────────────────────── */
.bb-resource-link {
  padding: 16px;
  background: #f8faf9;
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-sm);
  height: 100%;
}

/* ── Texture timeline ──────────────────────────────────────────────────── */
.bb-texture-timeline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px;
  background: #f8faf9;
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-sm);
}
.bb-texture-step {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bb-texture-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.bb-texture-arrow { color: var(--bb-muted); font-size: 0.9rem; }

/* ── Baby switcher ─────────────────────────────────────────────────────── */
.baby-switcher {
  padding: 10px 14px;
  background: #f5f9f6;
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-sm);
}

/* ── Dashboard header ──────────────────────────────────────────────────── */
.bb-dashboard-header {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius);
  box-shadow: var(--bb-shadow);
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 576px) {
  .bb-texture-timeline { flex-direction: column; align-items: flex-start; }
  .bb-texture-arrow { transform: rotate(90deg); }
  .bb-cal-cell { min-height: 56px; }
  .bb-dashboard-header .d-flex { flex-direction: column; }
}
