/* ============================================================
   FamHub 2.0 — Premium pastel concept design
   Inspired by the FamHub redesign reference image.
   Soft, expensive, easy-to-use family management.
============================================================ */

:root {
  /* Surfaces */
  --bg: #fafbfc;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #f0f2f5;
  --border: #ececf1;
  --border-soft: #f1f2f6;
  --border-strong: #d8d9e0;

  /* Text */
  --text: #0f0f14;
  --text-soft: #4a4a55;
  --text-dim: #7c7c8b;
  --text-mute: #aaaab7;

  /* Brand palette (pastel concept) */
  --purple: #8b5cf6;
  --purple-2: #7c3aed;
  --purple-soft: #f3eefe;
  --purple-tint: #ede4ff;

  --cyan: #14b8a6;
  --cyan-2: #0d9488;
  --cyan-soft: #e6fbf6;
  --cyan-tint: #d1f5ec;

  --green: #10b981;
  --green-2: #059669;
  --green-soft: #e7faf1;
  --green-tint: #d1f4e1;

  --orange: #f59e0b;
  --orange-2: #d97706;
  --orange-soft: #fff5e6;
  --orange-tint: #ffe9c9;

  --pink: #ec4899;
  --pink-soft: #fde9f3;

  --coral: #fb7185;
  --coral-2: #f43f5e;
  --coral-soft: #ffe4e6;
  --coral-tint: #ffd1d6;

  --peach: #fb923c;
  --peach-soft: #ffead0;

  --yellow: #facc15;
  --yellow-soft: #fef8d6;
  --yellow-warm: #fbbf24;

  --red: #ef4444;
  --red-soft: #fee2e2;

  --blue: #3b82f6;
  --blue-soft: #e0edff;

  /* Logo gradient */
  --logo-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);

  --radius: 18px;
  --radius-sm: 12px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --shadow-xs: 0 1px 2px rgba(16, 16, 32, 0.04);
  --shadow-sm: 0 2px 6px rgba(16, 16, 32, 0.04), 0 1px 2px rgba(16, 16, 32, 0.02);
  --shadow: 0 6px 20px rgba(16, 16, 32, 0.05), 0 2px 6px rgba(16, 16, 32, 0.03);
  --shadow-md: 0 12px 28px rgba(16, 16, 32, 0.07), 0 4px 10px rgba(16, 16, 32, 0.03);
  --shadow-lg: 0 24px 56px rgba(16, 16, 32, 0.10), 0 8px 18px rgba(16, 16, 32, 0.04);

  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background:
    radial-gradient(800px 500px at 100% -10%, rgba(251, 113, 133, 0.06), transparent 65%),
    radial-gradient(700px 480px at 0% 110%, rgba(139, 92, 246, 0.05), transparent 65%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  font-feature-settings: "cv11", "ss01";
}
input, textarea, select { user-select: text; font-family: inherit; }
a { color: var(--purple); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ====== BRAND LOGO ====== */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  position: relative;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.30), transparent 55%),
    linear-gradient(135deg, #4f46e5 0%, #8b5cf6 50%, #c026d3 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.32),
    inset 0 -1px 0 rgba(0,0,0,0.10),
    0 10px 22px rgba(139, 92, 246, 0.34),
    0 2px 4px rgba(79, 70, 229, 0.22);
}
.brand-logo svg {
  width: 62%; height: 62%;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.14));
}
.brand-logo::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.20);
  pointer-events: none;
}
.brand-mark.sm { font-size: 19px; gap: 10px; }
.brand-mark.sm .brand-logo { width: 36px; height: 36px; border-radius: 11px; }
.brand-mark.sm .brand-logo::after { border-radius: 10px; }
.brand-text small {
  font-size: 11px;
  color: var(--purple);
  margin-left: 6px;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: 2px;
}
.grad {
  background: var(--logo-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wave {
  display: inline-block;
  animation: wave 2.2s ease infinite;
  transform-origin: 70% 70%;
}
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

/* ====== ONBOARDING ====== */
.onboarding {
  min-height: 100vh;
  padding: calc(28px + var(--safe-top)) 22px calc(28px + var(--safe-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(900px 500px at 50% -10%, var(--purple-soft), transparent 65%),
    radial-gradient(600px 380px at 110% 110%, var(--cyan-soft), transparent 70%),
    var(--bg);
}
.onboarding-inner { max-width: 480px; width: 100%; text-align: center; }
.onboarding h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 36px;
  margin: 22px 0 10px;
  letter-spacing: -0.035em;
  font-weight: 800;
  line-height: 1.1;
}
.onboarding .lead {
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 28px;
}
.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 26px;
}
.feat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: transform .15s, box-shadow .2s;
}
.feat:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.feat .feat-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  margin-bottom: 10px;
}
.feat.feat-purple .feat-icon { background: var(--purple-soft); color: var(--purple); }
.feat.feat-green .feat-icon { background: var(--green-soft); color: var(--green); }
.feat.feat-orange .feat-icon { background: var(--orange-soft); color: var(--orange); }
.feat.feat-cyan .feat-icon { background: var(--cyan-soft); color: var(--cyan); }
.feat h3 { margin: 4px 0 2px; font-size: 14px; font-weight: 700; color: var(--text); }
.feat p { margin: 0; font-size: 11px; color: var(--text-dim); }

.onboarding-form label {
  display: block; text-align: left; font-size: 13px;
  color: var(--text-soft); margin-bottom: 8px; font-weight: 600;
}
.onboarding-form input[type=text] { width: 100%; margin-bottom: 16px; }
.onboarding-form .micro { margin: 14px 0 12px; color: var(--text-dim); font-size: 12px; }
.join {
  display: flex; justify-content: center; gap: 6px;
  font-size: 13px; color: var(--text-dim); flex-wrap: wrap;
}

/* ====== APP SHELL ====== */
.app { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
  padding-top: var(--safe-top);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
}
.topbar-right { display: flex; gap: 10px; align-items: center; }

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 42px; height: 42px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: transform .12s, background .15s, border-color .15s;
  position: relative;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.icon-btn-bell .bell-dot {
  position: absolute; top: 9px; right: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--purple);
  border: 2px solid var(--surface);
}

.avatar-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid var(--surface);
  background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
  color: #fff; font-weight: 800; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.main { flex: 1; padding: 22px 18px calc(120px + var(--safe-bottom)); }
.view { display: none; animation: fadeUp .22s ease; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform:none; } }

.view-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 0 16px;
}
.view-head h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 24px; margin: 0;
  letter-spacing: -0.025em; color: var(--text); font-weight: 800;
}
.view-head h2 i { color: var(--purple); font-size: 19px; margin-right: 8px; }
.head-actions { display: flex; gap: 8px; }
.sub { color: var(--text-soft); font-size: 14px; line-height: 1.55; margin: 0 0 18px; }

/* ====== FAMILY WELCOME HERO ====== */
.welcome-hero {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 24px 22px 22px;
  margin-bottom: 18px;
  overflow: hidden;
  background:
    radial-gradient(160px 120px at 88% 22%, rgba(251, 113, 133, 0.20), transparent 70%),
    radial-gradient(180px 140px at 12% 110%, rgba(34, 211, 238, 0.16), transparent 70%),
    linear-gradient(135deg, #f4ebff 0%, #fef0e6 60%, #ffe4e6 100%);
  border: 1px solid var(--border-soft);
}
.welcome-deco {
  position: absolute;
  border-radius: 50%;
  filter: blur(0.4px);
  opacity: 0.95;
  pointer-events: none;
}
.welcome-deco-1 {
  width: 84px; height: 84px;
  background: linear-gradient(135deg, #a78bfa 0%, #818cf8 100%);
  top: -22px; right: -10px;
  opacity: 0.18;
}
.welcome-deco-2 {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
  bottom: -16px; right: 38px;
  opacity: 0.20;
}
.welcome-deco-3 {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  top: 18px; left: -8px;
  opacity: 0.18;
}
.welcome-content { position: relative; z-index: 1; }
.welcome-row {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 14px;
}
.welcome-text { flex: 1; min-width: 0; }
.welcome-greet {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--purple);
  background: rgba(255,255,255,0.7);
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 10px;
}
.welcome-h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 26px;
  margin: 0 0 4px;
  letter-spacing: -0.035em;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
}
.welcome-h1 .wave { display: inline-block; }
.welcome-sub { color: var(--text-soft); font-size: 14px; margin: 0; font-weight: 500; }

/* ====== FAMILY CIRCLE (members carousel) ====== */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 12px;
}
.section-title.inside {
  margin: 0 0 14px;
}
.section-title h3 {
  margin: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.section-title h3 i {
  color: var(--coral);
  margin-right: 6px;
  font-size: 14px;
}
.family-circle-wrap {
  margin-bottom: 18px;
}
.family-circle {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: none;
}
.family-circle::-webkit-scrollbar { display: none; }
.family-circle .fc-item {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px 12px 12px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .2s, transform .12s;
  min-width: 150px;
  box-shadow: var(--shadow-xs);
}
.family-circle .fc-item:hover { border-color: var(--purple); box-shadow: var(--shadow-sm); }
.family-circle .fc-item:active { transform: scale(0.98); }
.family-circle .fc-item.me {
  border-color: var(--purple);
  background: linear-gradient(135deg, #ffffff 0%, var(--purple-soft) 100%);
}
.family-circle .fc-av {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.family-circle .fc-body { min-width: 0; }
.family-circle .fc-name {
  font-weight: 700; font-size: 13px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.family-circle .fc-pts {
  font-size: 11px; color: var(--text-dim); font-weight: 600;
}
.family-circle .fc-pts i { color: var(--green); margin-right: 3px; }
.family-circle .fc-add {
  flex-shrink: 0;
  background: var(--surface);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  min-width: 80px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  color: var(--text-soft);
  cursor: pointer;
  transition: all .15s;
}
.family-circle .fc-add:hover { border-color: var(--purple); color: var(--purple); }
.family-circle .fc-add i { font-size: 16px; }
.family-circle .fc-add span { font-size: 11px; font-weight: 600; }

/* ====== TODAY CARD ====== */
.today-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-xs);
}
.today-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.today-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  transition: border-color .15s, transform .12s;
}
.today-row:hover { border-color: var(--purple); }
.today-row .td-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--purple-soft); color: var(--purple);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.today-row .td-body { flex: 1; min-width: 0; }
.today-row .td-title { font-weight: 700; font-size: 14px; color: var(--text); line-height: 1.3; }
.today-row .td-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.today-row .td-pts {
  background: var(--green-soft); color: var(--green);
  padding: 4px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.today-row .td-av {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
  margin-right: 3px;
}
.today-empty {
  text-align: center;
  padding: 22px 16px;
  color: var(--text-dim);
  font-size: 13px;
}
.today-empty i {
  font-size: 26px;
  color: var(--coral);
  display: block;
  margin-bottom: 8px;
}

/* ====== STAT CARD COLOR VARIANTS (extra warm tones) ====== */

/* ====== HOME — GREETING + DATE PILL ====== */
.greet-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}
.greet-h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 28px;
  margin: 0 0 4px;
  letter-spacing: -0.035em;
  font-weight: 800;
  line-height: 1.15;
}
.greet-sub { color: var(--text-dim); font-size: 14px; margin: 0; }
.date-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
}
.date-pill i { color: var(--text-dim); font-size: 13px; }

/* ====== STAT CARDS ====== */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.stat-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  border: 1px solid var(--border-soft);
  min-height: 130px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .15s, box-shadow .25s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card.stat-purple { background: linear-gradient(135deg, #f5edff 0%, #ede4ff 100%); }
.stat-card.stat-cyan { background: linear-gradient(135deg, #e6fbf6 0%, #d1f5ec 100%); }
.stat-card.stat-green { background: linear-gradient(135deg, #ecfdf5 0%, #d1f4e1 100%); }
.stat-card.stat-orange { background: linear-gradient(135deg, #fff7ed 0%, #ffead0 100%); }
.stat-card.stat-coral { background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%); }
.stat-card.stat-yellow { background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%); }
.stat-card.stat-pink { background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%); }

.stat-card .stat-icon {
  width: 50px; height: 50px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: var(--surface);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}
.stat-card.stat-purple .stat-icon { color: var(--purple); }
.stat-card.stat-cyan .stat-icon { color: var(--cyan); }
.stat-card.stat-green .stat-icon { color: var(--green); }
.stat-card.stat-orange .stat-icon { color: var(--orange); }
.stat-card.stat-coral .stat-icon { color: var(--coral); }
.stat-card.stat-yellow .stat-icon { color: #b08300; }
.stat-card.stat-pink .stat-icon { color: var(--pink); }

.stat-body { display: flex; flex-direction: column; gap: 2px; }
.stat-label {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 600;
}
.stat-num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  margin: 2px 0;
}
.stat-foot {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
}
.stat-bg-icon {
  position: absolute;
  bottom: -8px; right: -6px;
  font-size: 64px;
  opacity: 0.18;
  pointer-events: none;
}
.stat-card.stat-purple .stat-bg-icon { color: var(--purple); }
.stat-card.stat-cyan .stat-bg-icon { color: var(--cyan); }
.stat-card.stat-green .stat-bg-icon { color: var(--green); }
.stat-card.stat-orange .stat-bg-icon { color: var(--orange); }
.stat-card.stat-coral .stat-bg-icon { color: var(--coral); }
.stat-card.stat-yellow .stat-bg-icon { color: #d4a017; }
.stat-card.stat-pink .stat-bg-icon { color: var(--pink); }

/* ====== SUBSCRIPTION CARD ====== */
.sub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-xs);
}
.sub-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.28);
}
.sub-body { flex: 1; min-width: 0; }
.sub-label { font-size: 13px; color: var(--text-dim); font-weight: 500; display: block; margin-bottom: 2px; }
.sub-plan {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px; font-weight: 800;
  color: var(--text); display: block; letter-spacing: -0.02em;
}
.sub-bar {
  margin-top: 10px;
  height: 8px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
}
.sub-bar-fill {
  height: 100%;
  background: var(--logo-grad);
  border-radius: 99px;
}
.sub-foot { margin-top: 8px; font-size: 12px; color: var(--text-dim); display: inline-flex; align-items: center; gap: 6px; }
.sub-foot i { color: var(--text-dim); }
.sub-meta { text-align: right; flex-shrink: 0; }
.sub-meta-num { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 20px; color: var(--purple); display: block; }
.sub-meta-lab { font-size: 11px; color: var(--text-dim); }

/* ====== CHART CARD ====== */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-xs);
}
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.chart-head h3 {
  margin: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.chart-head h3 i { color: var(--purple); margin-right: 6px; font-size: 16px; }
.chart-controls select {
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 10px;
  width: auto;
  font-weight: 500;
  color: var(--text);
}
.chart-legend {
  display: flex; gap: 18px; margin: 4px 0 10px;
  font-size: 12px; color: var(--text-soft);
  font-weight: 500;
}
.chart-legend .dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; vertical-align: middle; margin-right: 6px;
}
.chart-legend .dot-purple { background: var(--purple); }
.chart-legend .dot-green { background: var(--green); }
.chart-wrap {
  width: 100%;
  overflow-x: auto;
  padding-top: 4px;
}
.chart-wrap canvas {
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
  display: block;
}

/* ====== FEATURED ROW (Scanner + Boodschappen) ====== */
.featured-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.featured-tile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .25s, border-color .15s;
  position: relative;
  overflow: hidden;
}
.featured-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.featured-tile:active { transform: scale(0.985); }
.featured-tile .ft-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px;
  color: #fff;
  flex-shrink: 0;
}
.featured-scanner .ft-icon {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  box-shadow: 0 10px 24px rgba(139, 92, 246, 0.32);
}
.featured-list .ft-icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.30);
}
.featured-tile .ft-body { flex: 1; min-width: 0; }
.featured-tile .ft-body strong {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 17px; font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-bottom: 3px;
}
.featured-tile .ft-body small {
  display: block;
  font-size: 12px; color: var(--text-dim);
  line-height: 1.35;
}
.featured-tile .ft-arrow {
  color: var(--text-mute);
  font-size: 14px;
  flex-shrink: 0;
}

@media (min-width: 480px) {
  .featured-row { grid-template-columns: 1fr 1fr; }
  .featured-tile .ft-body small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ====== QUICK ACTIONS ====== */
.quick-actions {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-xs);
}
.quick-head h3 {
  margin: 0 0 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.quick-head h3 i { color: var(--purple); margin-right: 6px; font-size: 15px; }
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.quick-tile {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  transition: transform .12s;
  color: var(--text);
}
.quick-tile:active { transform: scale(0.95); }
.quick-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  transition: transform .15s, box-shadow .2s;
}
.quick-tile:hover .quick-icon { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.quick-icon.quick-purple { background: var(--purple-soft); color: var(--purple); }
.quick-icon.quick-cyan { background: var(--cyan-soft); color: var(--cyan); }
.quick-icon.quick-green { background: var(--green-soft); color: var(--green); }
.quick-icon.quick-orange { background: var(--orange-soft); color: var(--orange); }
.quick-label {
  font-size: 12px; font-weight: 600; text-align: center; line-height: 1.25;
  color: var(--text-soft);
}

/* ====== TASKS ====== */
.task-list {
  display: flex; flex-direction: column; gap: 10px;
}
.task-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  transition: border-color .15s, box-shadow .2s, transform .12s;
  box-shadow: var(--shadow-xs);
}
.task-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.task-item.done { opacity: 0.55; }
.task-check {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  flex-shrink: 0;
  transition: all .15s;
}
.task-check:hover { border-color: var(--purple); }
.task-item.done .task-check {
  background: var(--green); border-color: var(--green); color: #fff;
}
.task-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--purple-soft);
  color: var(--purple);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 700; font-size: 15px; color: var(--text); line-height: 1.3; }
.task-item.done .task-title { text-decoration: line-through; color: var(--text-dim); }
.task-meta {
  display: flex; gap: 8px; align-items: center;
  margin-top: 4px; font-size: 12px; color: var(--text-dim);
  flex-wrap: wrap;
}
.task-meta .tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px;
  background: var(--surface-3);
  font-size: 11px; font-weight: 600;
}
.task-meta .tag.points { background: var(--green-soft); color: var(--green); }
.task-meta .tag.due-near { background: var(--orange-soft); color: var(--orange); }
.task-meta .tag.due-late { background: var(--red-soft); color: var(--red); }
.task-meta .assignee-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px 2px 4px;
  border-radius: 99px;
  background: var(--surface-3);
  font-size: 11px; font-weight: 600;
  color: var(--text-soft);
}
.task-meta .assignee-chip .av {
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px;
}
.task-actions {
  display: flex; gap: 4px;
}
.task-actions .icon-btn { width: 32px; height: 32px; font-size: 13px; }

.member-chips {
  display: flex; gap: 8px;
  overflow-x: auto; padding: 4px 2px 12px;
  scrollbar-width: none;
}
.member-chips::-webkit-scrollbar { display: none; }
.member-chips .mc {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px 12px 6px 6px;
  font-size: 13px; font-weight: 600;
  color: var(--text-soft);
  display: inline-flex; align-items: center; gap: 6px;
  transition: border-color .15s, background .15s;
}
.member-chips .mc:hover { border-color: var(--border-strong); }
.member-chips .mc.active {
  background: var(--text); border-color: var(--text); color: #fff;
}
.member-chips .mc .av {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
}

/* ====== LIJSTEN (shopping) ====== */
.add-shop {
  display: grid;
  grid-template-columns: 1fr 72px 50px;
  gap: 8px;
  margin-bottom: 14px;
}
.shop-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.shop-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-xs);
}
.shop-list li.done { background: var(--surface-2); opacity: 0.55; }
.shop-list li.done .sl-name { text-decoration: line-through; }
.shop-list .check-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: transparent; transition: all .15s; flex-shrink: 0;
}
.shop-list .check-btn:hover { border-color: var(--purple); }
.shop-list li.done .check-btn {
  background: var(--green); border-color: var(--green); color: #fff;
}
.shop-list .sl-name { flex: 1; font-weight: 600; color: var(--text); font-size: 15px; }
.shop-list .sl-qty {
  background: var(--purple); color: #fff;
  padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 700;
}
.shop-list .sl-del {
  background: transparent; border: none;
  color: var(--text-mute); width: 28px; height: 28px; border-radius: 6px;
}
.shop-list .sl-del:hover { color: var(--red); background: var(--red-soft); }

/* ====== WEEKMENU ====== */
.weekmenu-list {
  display: flex; flex-direction: column; gap: 10px;
}
.weekday {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: border-color .15s, box-shadow .2s;
}
.weekday:hover { border-color: var(--purple); box-shadow: var(--shadow-sm); }
.weekday .wd-day {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--purple-soft);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.weekday .wd-day .wd-day-num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px; font-weight: 800; color: var(--purple);
  line-height: 1;
}
.weekday .wd-day .wd-day-lab {
  font-size: 11px; font-weight: 600; color: var(--purple);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.weekday.today .wd-day { background: var(--purple); }
.weekday.today .wd-day .wd-day-num,
.weekday.today .wd-day .wd-day-lab { color: #fff; }
.weekday .wd-body { flex: 1; min-width: 0; }
.weekday .wd-name { font-weight: 700; color: var(--text); font-size: 15px; }
.weekday .wd-meal { font-size: 13px; color: var(--text-soft); margin-top: 4px; }
.weekday .wd-meal.empty { color: var(--text-mute); font-style: italic; }
.weekday .wd-arrow { color: var(--text-mute); font-size: 14px; }

/* ====== MORE GRID ====== */
.more-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.more-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform .12s, border-color .15s, box-shadow .25s;
  box-shadow: var(--shadow-xs);
  color: var(--text);
}
.more-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.more-tile:active { transform: scale(0.97); }
.more-tile .more-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 10px;
}
.more-icon.more-purple { background: var(--purple-soft); color: var(--purple); }
.more-icon.more-cyan { background: var(--cyan-soft); color: var(--cyan); }
.more-icon.more-green { background: var(--green-soft); color: var(--green); }
.more-icon.more-orange { background: var(--orange-soft); color: var(--orange); }
.more-icon.more-pink { background: var(--pink-soft); color: var(--pink); }
.more-icon.more-yellow { background: var(--yellow-soft); color: #b08300; }
.more-icon.more-gray { background: var(--surface-3); color: var(--text-soft); }
.more-tile .more-label { font-weight: 700; font-size: 15px; color: var(--text); }
.more-tile .more-foot { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ====== MEMBERS LIST ====== */
.members-list { display: flex; flex-direction: column; gap: 10px; }
.member-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-xs);
}
.member-item .av {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: #fff;
  flex-shrink: 0;
}
.member-item .mi-body { flex: 1; min-width: 0; }
.member-item .mi-name { font-weight: 700; font-size: 16px; color: var(--text); }
.member-item .mi-role { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.member-item .mi-points {
  background: var(--green-soft); color: var(--green);
  padding: 6px 12px; border-radius: 99px;
  font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
}
.member-item .mi-points i { font-size: 11px; }
.member-item .mi-del {
  background: transparent; border: none;
  color: var(--text-mute); width: 32px; height: 32px; border-radius: 8px;
}
.member-item .mi-del:hover { color: var(--red); background: var(--red-soft); }

/* ====== REWARDS ====== */
.rewards-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.reward-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-xs);
  transition: border-color .15s;
}
.reward-item:hover { border-color: var(--purple); }
.reward-item .rw-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--orange-soft);
  color: var(--orange);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.reward-item .rw-body { flex: 1; min-width: 0; }
.reward-item .rw-title { font-weight: 700; font-size: 15px; color: var(--text); }
.reward-item .rw-desc { font-size: 13px; color: var(--text-soft); margin-top: 2px; }
.reward-item .rw-cost {
  background: var(--purple); color: #fff;
  padding: 6px 12px; border-radius: 99px;
  font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.reward-item .rw-cost i { font-size: 11px; }
.reward-item .rw-actions { display: flex; gap: 4px; flex-direction: column; }

/* ====== REPORTS — leaderboard ====== */
.leaderboard { display: flex; flex-direction: column; gap: 8px; }
.lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.lb-row.lb-1 { background: linear-gradient(135deg, #fef3c7 0%, #fff5e6 100%); }
.lb-row.lb-2 { background: var(--surface-3); }
.lb-row.lb-3 { background: linear-gradient(135deg, #ffe4d6 0%, #fff5e6 100%); }
.lb-rank {
  width: 28px; height: 28px;
  border-radius: 50%; background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
  border: 1px solid var(--border);
}
.lb-row.lb-1 .lb-rank { background: #fbbf24; color: #fff; border-color: #fbbf24; }
.lb-row.lb-2 .lb-rank { background: #94a3b8; color: #fff; border-color: #94a3b8; }
.lb-row.lb-3 .lb-rank { background: #fb923c; color: #fff; border-color: #fb923c; }
.lb-av {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
}
.lb-name { flex: 1; font-weight: 700; color: var(--text); }
.lb-pts {
  background: var(--surface); color: var(--text);
  padding: 5px 12px; border-radius: 99px;
  font-weight: 700; font-size: 13px;
}

.activity-feed { display: flex; flex-direction: column; gap: 8px; }
.activity-feed .af {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 10px;
  font-size: 13px;
}
.activity-feed .af-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--purple-soft); color: var(--purple);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.activity-feed .af-text { flex: 1; color: var(--text); }
.activity-feed .af-time { font-size: 11px; color: var(--text-dim); }

/* ====== SCANNER ====== */
.scan-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.scan-mode {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 20px 16px;
  text-align: left;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 130px;
  transition: transform .12s, border-color .15s, box-shadow .25s;
  box-shadow: var(--shadow-xs);
}
.scan-mode:hover { transform: translateY(-2px); border-color: var(--purple); box-shadow: var(--shadow-sm); }
.scan-mode:active { transform: scale(0.97); }
.scan-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--purple-soft); color: var(--purple);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 6px;
}
.scan-mode strong { font-size: 14px; font-weight: 700; color: var(--text); }
.scan-mode small { color: var(--text-dim); font-size: 12px; }

/* ====== INVENTORY ====== */
.inv-list { display: flex; flex-direction: column; gap: 8px; }
.inv-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-xs);
}
.inv-item .iv-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--purple-soft);
  color: var(--purple);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.inv-item .iv-body { flex: 1; min-width: 0; }
.inv-item .iv-name { font-weight: 700; font-size: 14px; color: var(--text); }
.inv-item .iv-meta { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.inv-item .iv-meta .tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: var(--surface-3); color: var(--text-soft);
  font-size: 11px; margin-right: 4px; font-weight: 600;
}
.inv-item .iv-meta .tag.tht-near { background: var(--orange-soft); color: var(--orange); }
.inv-item .iv-meta .tag.tht-bad { background: var(--red-soft); color: var(--red); }
.inv-item .iv-qty {
  background: var(--purple); color: #fff;
  padding: 4px 10px; border-radius: 99px;
  font-weight: 700; font-size: 12px;
}
.inv-item .iv-del {
  background: transparent; border: none;
  color: var(--text-mute); width: 32px; height: 32px; border-radius: 8px;
}
.inv-item .iv-del:hover { color: var(--red); background: var(--red-soft); }

/* ====== CHIP ROW ====== */
.chip-row {
  display: flex; gap: 8px;
  overflow-x: auto; padding: 4px 2px 12px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-row .chip {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-soft);
  cursor: pointer;
  font-weight: 600;
  transition: all .15s;
}
.chip-row .chip:hover { border-color: var(--border-strong); }
.chip-row .chip.active {
  background: var(--text); border-color: var(--text); color: #fff;
}

.filters { margin-bottom: 14px; }

/* ====== INPUTS ====== */
input[type=text], input[type=number], input[type=date], input[type=search], input[type=email], input[type=tel], textarea, select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
}
textarea { resize: vertical; min-height: 84px; }
label {
  display: block; font-size: 13px; color: var(--text-soft);
  margin: 12px 0 6px; font-weight: 600;
}
.row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.row-buttons {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px;
}
.row-buttons .btn { flex: 1; }
.mono { font-family: 'SF Mono', Menlo, Consolas, monospace; }
.small { font-size: 12px; color: var(--text-soft); }
.micro { font-size: 11px; color: var(--text-mute); }

/* ====== BUTTONS ====== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px; font-weight: 700;
  font-family: inherit;
  transition: transform .12s, background .15s, border-color .15s, opacity .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--purple); color: #fff;
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.28);
}
.btn-primary:hover { background: var(--purple-2); }
.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-ghost.danger { color: var(--red); }
.btn-ghost.danger:hover { background: var(--red-soft); border-color: #fecaca; }
.btn-large { width: 100%; padding: 15px; font-size: 15px; }

.link {
  background: none; border: none; color: var(--purple);
  font-size: 13px; font-weight: 700; cursor: pointer; padding: 4px 6px;
}
.link:hover { color: var(--purple-2); text-decoration: underline; }

/* ====== EMPTY STATES ====== */
.big-empty {
  text-align: center;
  padding: 64px 30px;
}
.big-empty .big-empty-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--purple-soft);
  color: var(--purple);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 30px; margin-bottom: 16px;
}
.big-empty h3 { font-size: 18px; margin: 0 0 6px; color: var(--text); font-weight: 700; }
.big-empty p { color: var(--text-soft); margin: 0 0 20px; max-width: 320px; margin-left: auto; margin-right: auto; }

.empty {
  text-align: center; color: var(--text-dim);
  padding: 14px; font-size: 13px;
}

/* ====== AI CARDS ====== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
}
.card h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin: 0 0 12px;
  font-size: 17px; font-weight: 700; color: var(--text);
  letter-spacing: -0.015em;
}
.card h3 i { color: var(--purple); margin-right: 6px; }
.ai-card p { color: var(--text-soft); font-size: 14px; line-height: 1.55; margin: 0 0 14px; }
.ai-result { margin-top: 14px; }
.ai-result:empty { display: none; }
.ai-meal {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}
.ai-meal h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin: 0 0 6px;
  font-size: 16px; color: var(--purple); font-weight: 700;
}
.ai-meal .why { font-size: 13px; color: var(--text-soft); margin: 0 0 10px; line-height: 1.5; }
.ai-meal .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.ai-meal .tag {
  background: var(--green-soft); color: var(--green);
  padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 600;
}
.ai-meal .tag.miss { background: var(--orange-soft); color: var(--orange); }
.ai-meal .actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.ai-meal .actions .btn { padding: 7px 12px; font-size: 12px; }

/* ====== MODALS ====== */
.modal {
  position: fixed; inset: 0;
  background: rgba(15, 15, 30, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn .2s;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal-card {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  max-height: 92vh;
  display: flex; flex-direction: column;
  border: 1px solid var(--border);
  border-bottom: 0;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px 14px;
}
.modal-head h3 {
  margin: 0; font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 19px; color: var(--text); font-weight: 800;
  letter-spacing: -0.02em;
}
.modal-body { padding: 4px 20px 20px; overflow-y: auto; flex: 1; }
.modal-body.center { text-align: center; }
.modal-foot {
  padding: 14px 20px calc(14px + var(--safe-bottom));
  display: flex; gap: 10px;
  border-top: 1px solid var(--border);
}
.modal-foot .btn { flex: 1; }

.cam-card { max-height: 95vh; }
.cam-body {
  padding: 0;
  position: relative;
  background: #000;
  min-height: 60vh;
  overflow: hidden;
}
.cam-hint {
  position: absolute;
  bottom: 16px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin: 0;
  font-weight: 600;
}
.scan-region {
  position: relative;
  width: 100%;
  min-height: 60vh;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scan-region video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}
.scan-region > div { width: 100% !important; }
.scan-region::after {
  content: "";
  position: absolute;
  width: 88%; max-width: 480px; height: 44%;
  border: 2px dashed rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.20);
  pointer-events: none;
  z-index: 10;
  animation: scanPulse 2s ease-in-out infinite;
}
@keyframes scanPulse {
  0%, 100% { border-color: rgba(255,255,255,0.5); }
  50% { border-color: rgba(139,92,246,0.95); }
}
#torchBtn.active {
  background: var(--yellow-warm, #fbbf24);
  color: #fff;
  border-color: var(--yellow-warm, #fbbf24);
}

.product-preview {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
}
.product-preview img {
  width: 56px; height: 56px;
  border-radius: 10px;
  object-fit: cover; background: #fff;
  border: 1px solid var(--border);
}
.product-preview strong { display: block; font-size: 15px; color: var(--text); }
.product-preview small { color: var(--text-dim); font-size: 12px; }

.file-pick {
  display: block;
  background: var(--surface-2);
  border: 2px dashed var(--border-strong);
  border-radius: 14px;
  padding: 28px 16px;
  text-align: center;
  color: var(--text-soft);
  cursor: pointer;
  margin: 14px 0 8px;
  transition: border-color .15s, background .15s;
}
.file-pick:hover { border-color: var(--purple); background: var(--purple-soft); }
.file-pick input { display: none; }
.file-pick i {
  font-size: 28px; display: block; margin-bottom: 10px; color: var(--purple);
}
.ask-preview { max-width: 100%; max-height: 200px; border-radius: 10px; margin-top: 10px; }

.qr-code {
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

/* ====== ICON / EMOJI / COLOR PICKERS ====== */
.icon-picker, .emoji-picker, .color-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin: 8px 0 0;
}
.icon-picker .ip,
.emoji-picker .ep {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  cursor: pointer;
  transition: all .12s;
}
.icon-picker .ip i { color: var(--text-soft); }
.icon-picker .ip:hover, .emoji-picker .ep:hover { border-color: var(--purple); }
.icon-picker .ip.active,
.emoji-picker .ep.active {
  background: var(--purple); border-color: var(--purple);
}
.icon-picker .ip.active i { color: #fff; }

.color-picker .cp {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid var(--surface);
  outline: 1px solid var(--border);
  cursor: pointer;
  transition: transform .12s, outline-color .15s;
}
.color-picker .cp.active {
  outline: 2px solid var(--text);
  transform: scale(1.05);
}

.member-picker {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.member-picker .mp {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  transition: all .15s;
}
.member-picker .mp:hover { border-color: var(--purple); }
.member-picker .mp.disabled { opacity: 0.5; cursor: not-allowed; }
.member-picker .mp .av {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; flex-shrink: 0;
}
.member-picker .mp .mp-body { flex: 1; min-width: 0; }
.member-picker .mp .mp-name { font-weight: 700; font-size: 14px; color: var(--text); }
.member-picker .mp .mp-pts { font-size: 12px; color: var(--text-dim); }

/* ====== BOTTOM NAV ====== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 40;
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--border-soft);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px var(--safe-bottom);
  box-shadow: 0 -2px 16px rgba(15, 15, 30, 0.04);
}
.nav-btn {
  background: none; border: none;
  color: var(--text-dim);
  padding: 8px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 11px;
  font-weight: 600;
  transition: color .15s;
}
.nav-btn .nav-pill {
  width: 56px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 16px;
  font-size: 18px;
  transition: background .2s, color .2s;
}
.nav-btn .nav-label {
  font-size: 11px;
  color: var(--text-dim);
}
.nav-btn.active .nav-pill {
  background: var(--purple-soft);
  color: var(--purple);
}
.nav-btn.active .nav-label {
  color: var(--purple);
}

/* FAB-style center scanner button */
.nav-btn.nav-fab {
  position: relative;
}
.nav-btn.nav-fab .fab {
  width: 58px; height: 58px;
  border-radius: 18px;
  background: var(--logo-grad);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-top: -22px;
  box-shadow: 0 12px 26px rgba(139, 92, 246, 0.42), 0 4px 8px rgba(0, 0, 0, 0.06);
  transition: transform .15s, box-shadow .2s;
}
.nav-btn.nav-fab:hover .fab { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(139, 92, 246, 0.50); }
.nav-btn.nav-fab:active .fab { transform: scale(0.94); }
.nav-btn.nav-fab.active .fab { box-shadow: 0 12px 26px rgba(139, 92, 246, 0.55); }
.nav-btn.nav-fab .nav-label {
  margin-top: -2px;
  font-weight: 700;
  color: var(--purple);
}
.nav-btn.nav-fab.active .nav-label { color: var(--purple); }

/* ====== TOASTS ====== */
.toasts {
  position: fixed;
  top: calc(20px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
  width: 100%;
  max-width: 480px;
  padding: 0 16px;
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  animation: toastIn .25s ease;
  pointer-events: auto;
  box-shadow: var(--shadow-lg);
}
.toast.ok i { color: #34d399; }
.toast.err i { color: #f87171; }
.toast.info i { color: #60a5fa; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } }

/* ====== LOADER ====== */
.loader {
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
}
.loader p { color: var(--text); font-weight: 600; margin: 0; font-size: 14px; }
.spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== DESKTOP ====== */
@media (min-width: 768px) {
  .main { padding: 32px 36px calc(120px + var(--safe-bottom)); max-width: 820px; margin: 0 auto; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .more-grid { grid-template-columns: repeat(3, 1fr); }
  .scan-modes { grid-template-columns: repeat(3, 1fr); }
  .features-grid { grid-template-columns: repeat(4, 1fr); }
  .topbar-inner { max-width: 820px; margin: 0 auto; }
  .bottom-nav {
    max-width: 600px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 20px 20px 0 0;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}
