:root {
  --primary: #16a34a;
  --primary-hover: #15803d;
  --primary-soft: #f0fdf4;
  --secondary: #0ea5e9;
  --accent: #f97316;
  --success: #22c55e;
  --success-soft: #f0fdf4;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --error: #ef4444;
  --error-soft: #fef2f2;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --surface: #ffffff;
  --page: #f8fafc;
  --muted-bg: #f1f5f9;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 12px rgba(15, 23, 42, .05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--page);
  line-height: 1.5;
}

h1, h2, h3 { font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif; margin: 0 0 8px; line-height: 1.2; }
h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .8125rem; }
.center { text-align: center; }
.error { color: var(--error); font-size: .8125rem; }

/* ---------- Sidebar + header ---------- */
.chrome { display: contents; }
body:has(.sidebar) { padding-left: 256px; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 256px; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 16px; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); font-size: 1.125rem;
  font-family: "Plus Jakarta Sans", Inter, sans-serif; padding: 4px 8px 20px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; border-radius: 10px;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-nav a, .side-nav .soon {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  color: var(--muted); font-weight: 600; font-size: .9375rem;
}
.side-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side-nav a:hover { background: var(--muted-bg); text-decoration: none; }
.side-nav a.active { background: var(--primary-soft); color: var(--primary); }
.side-nav .soon { opacity: .55; cursor: default; }
.side-nav .soon em { margin-left: auto; font-style: normal; font-size: .6875rem; background: var(--muted-bg); padding: 2px 8px; border-radius: 999px; }
.tip { background: #fff7ed; border-radius: var(--radius-lg); padding: 16px; font-size: .875rem; }
.tip strong { color: var(--accent); }
.tip p { margin: 4px 0 0; }
.topbar {
  display: flex; align-items: center; justify-content: flex-end; padding: 14px 32px;
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
.topbar-user { display: flex; align-items: center; gap: 12px; }
.topbar-user form { margin: 0; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; font-weight: 700;
}
.user-name { font-weight: 600; }

/* ---------- Layout ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 32px; }
.page-narrow { max-width: 720px; }
.back-link { display: inline-block; margin-bottom: 12px; font-size: .9375rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 24px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 24px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.card-head h3 { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius); border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; transition: background .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--primary-soft); color: var(--primary); }
.btn-secondary:hover { background: #dcfce7; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--muted-bg); }
.btn-light { background: #fff; color: var(--primary); }
.btn-sm { padding: 8px 14px; font-size: .875rem; }
.btn-block { width: 100%; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: .875rem; }
.field input, .field textarea {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  font: inherit; background: var(--surface);
}
.field input:focus, .field textarea:focus { border-color: var(--primary); }
.field.has-error input, .field.has-error textarea { border-color: var(--error); background: var(--error-soft); }
.field-group { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.field-group legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }

.choice-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.choice-row-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  position: relative; display: flex; flex-direction: column; gap: 2px; cursor: pointer;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-title { font-weight: 600; }
.choice-desc { font-size: .8125rem; color: var(--muted); }
.choice-chip { flex-direction: row; padding: 8px 16px; border-radius: 999px; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.choice:has(input:checked) .choice-title, .choice-chip:has(input:checked) { color: var(--primary); font-weight: 600; }
.choice:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Alerts / badges / chips ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius); margin: 16px 0; font-size: .9375rem; border: 1px solid; }
.alert-success { background: var(--success-soft); border-color: #bbf7d0; color: #166534; }
.alert-error { background: var(--error-soft); border-color: #fecaca; color: #b91c1c; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: var(--muted-bg); color: var(--muted);
}
.badge-done { background: var(--success-soft); color: #15803d; }
.badge-partial, .badge-today { background: var(--warning-soft); color: #b45309; }
.badge-missed, .badge-overdue { background: var(--error-soft); color: #b91c1c; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.chip { padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .22); color: #fff; font-size: .875rem; font-weight: 600; }
.chip-solid { display: inline-block; background: #fff; color: var(--primary); }

/* ---------- Auth (dua kolom) ---------- */
.auth-page { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; background: var(--surface); }
.auth-aside { background: linear-gradient(135deg, #16a34a, #0ea5e9); color: #fff; display: flex; align-items: center; padding: 48px; }
.auth-aside-inner { max-width: 480px; }
.auth-aside h2 { font-size: 2.25rem; line-height: 1.2; margin: 24px 0 32px; }
.brand-light { color: #fff; padding: 0; }
.brand-mark-light { background: #fff; color: var(--primary); }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.auth-points li { display: flex; align-items: center; gap: 14px; }
.point-icon { width: 40px; height: 40px; border-radius: 12px; background: #fff; color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; flex: none; }
.auth-card { width: 100%; max-width: 440px; align-self: center; justify-self: center; padding: 32px; }
.auth-tabs { display: flex; background: var(--muted-bg); border-radius: var(--radius); padding: 4px; margin-bottom: 24px; }
.auth-tab { flex: 1; text-align: center; padding: 8px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .875rem; }
.auth-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.auth-tab:hover { text-decoration: none; }
.auth-card .form { margin: 20px 0; }

/* ---------- Onboarding ---------- */
.onboarding-page { background: var(--page); }
.onboarding { max-width: 760px; margin: 0 auto; padding: 40px 24px; }
.onboarding-meta { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: .875rem; }
.step-label { color: var(--primary); font-weight: 600; }
.progress { height: 8px; background: var(--muted-bg); border-radius: 999px; overflow: hidden; margin: 8px 0 32px; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s; }
.option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 28px 0; }
.option {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); min-height: 112px;
}
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option-title { font-weight: 700; font-size: 1.0625rem; }
.option-desc { color: var(--muted); font-size: .875rem; }
.option:hover { border-color: #86efac; }
.option.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.option:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.onboarding-actions { display: flex; justify-content: space-between; align-items: center; }

/* ---------- Dashboard ---------- */
.hero {
  position: relative; overflow: hidden; margin: 24px 0; padding: 32px; border-radius: var(--radius-xl); color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}
.hero h2 { font-size: 2.75rem; margin: 8px 0 0; }
.hero-body { position: relative; z-index: 1; }
.hero-circle { position: absolute; right: 64px; top: 50%; width: 200px; height: 200px; margin-top: -100px;
  border-radius: 50%; background: rgba(255, 255, 255, .18); }
.chip-level { background: #dcfce7; color: #15803d; }
.btn-lg { padding: 14px 28px; font-size: 1.0625rem; }
.hero-rest { background: linear-gradient(135deg, #64748b, #94a3b8); }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .08em; opacity: .9; }

.week-dots { display: flex; gap: 16px; margin-top: 12px; }
.day-dot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dot {
  width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); font-weight: 700; color: var(--muted);
}
.dot-done { background: var(--primary); border-color: var(--primary); color: #fff; }
.dot-partial { background: var(--warning-soft); border-color: var(--warning); color: #b45309; }
.dot-missed, .dot-overdue { background: var(--error-soft); border-color: var(--error); color: var(--error); }
.dot-today { border: 2px solid var(--primary); }
.dot-rest { background: var(--muted-bg); }
.day-label { font-size: .75rem; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stats-inline { grid-template-columns: repeat(3, 1fr); margin: 16px 0 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.stats-inline .stat { background: var(--page); }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.125rem; margin-bottom: 8px; }
.stat-icon-green { background: var(--primary-soft); color: var(--primary); }
.stat-icon-orange { background: #fff7ed; color: var(--accent); }
.stat-icon-blue { background: #e0f2fe; color: var(--secondary); }
.progress-sm { height: 6px; margin: 10px 0 0; }
.stat-value { font-family: "Plus Jakarta Sans", Inter, sans-serif; font-size: 1.75rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: .875rem; }

/* ---------- Plan ---------- */
.plan-list { list-style: none; margin: 24px 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.plan-item {
  display: flex; align-items: center; gap: 20px; padding: 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.plan-done { background: var(--success-soft); border-color: #86efac; }
.plan-partial { background: var(--warning-soft); border-color: #fcd34d; }
.plan-missed, .plan-overdue { background: var(--error-soft); border-color: #fca5a5; }
.plan-rest { background: var(--muted-bg); border-color: transparent; }
.plan-date {
  width: 64px; height: 64px; flex: none; border-radius: var(--radius); background: var(--muted-bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.plan-date-today { background: var(--primary); color: #fff; }
.plan-day { font-size: .6875rem; font-weight: 600; opacity: .8; }
.plan-num { font-size: 1.375rem; font-weight: 700; line-height: 1; }
.plan-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.plan-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-title strong { font-size: 1.125rem; }
.plan-meta { font-size: .875rem; }
.plan-actions { flex: none; }

/* ---------- Progress ---------- */
.score-row { display: flex; align-items: center; gap: 12px; margin: 8px 0 12px; }
.score { font-family: "Plus Jakarta Sans", Inter, sans-serif; font-size: 3rem; font-weight: 800; color: var(--primary); line-height: 1; }
.history { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.history li { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: var(--page); border-radius: var(--radius); }
.history-date { font-weight: 600; min-width: 56px; }
.history-title { flex: 1; font-weight: 600; }
.history-meta { min-width: 120px; text-align: right; font-size: .8125rem; }

.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.link-strong { font-weight: 600; font-size: .875rem; }
.mini-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.mini-list li { display: flex; align-items: center; gap: 14px; }
.mini-icon { width: 36px; height: 36px; border-radius: 10px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--muted-bg); color: var(--muted); font-weight: 700; }
.mini-text { flex: 1; display: flex; flex-direction: column; }
.mini-sub { font-size: .75rem; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 12px; height: 200px; margin-top: 16px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar { width: 28px; background: var(--primary); border-radius: 8px; min-height: 6px; }
.bar-empty { height: 24px; background: var(--muted-bg); }
.bar-label { font-size: .75rem; color: var(--muted); }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.quick-item { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); color: var(--text); font-weight: 600; }
.quick-item:hover { text-decoration: none; border-color: #86efac; }
.quick-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--muted-bg); display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Pola Makan ---------- */
.section-title { font-size: 1.5rem; margin: 32px 0 16px; }
.chip-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 8px; }
.pref-chip { padding: 8px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: .875rem; color: var(--muted); }
.pref-chip-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.meal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.meal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.meal-banner { height: 120px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem;
  background: linear-gradient(135deg, #bbf7d0, #e0f2fe); }
.meal-banner-lunch { background: linear-gradient(135deg, #fef3c7, #dcfce7); }
.meal-banner-dinner { background: linear-gradient(135deg, #e0f2fe, #bbf7d0); }
.meal-banner-snack { background: linear-gradient(135deg, #ffedd5, #fef9c3); }
.meal-banner-lg { height: 220px; border-radius: var(--radius-xl); font-size: 4rem; margin-bottom: 20px; }
.meal-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.meal-body h3 { font-size: 1.125rem; margin: 0; }
.eyebrow-green { color: var(--primary); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.meal-stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: .875rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 2px 10px; border-radius: 999px; background: var(--primary-soft); color: #15803d; font-size: .75rem; font-weight: 600; }
.meal-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.meal-actions form { margin: 0; flex: 1; }
.meal-actions .btn { width: 100%; }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--muted-bg); }
.week-meals { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.day-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.day-col-today { border: 2px solid var(--primary); }
.day-col-label { font-weight: 700; font-size: .8125rem; color: var(--muted); }
.day-col-today .day-col-label { color: var(--primary); }
.day-meal { display: flex; flex-direction: column; background: var(--page); border-radius: 10px; padding: 8px 10px; color: var(--text); font-size: .8125rem; font-weight: 500; }
.day-meal small { color: var(--muted); font-weight: 400; }
.day-meal:hover { text-decoration: none; background: var(--primary-soft); }
.mini-icon-green { background: var(--primary-soft); }
.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: start; }
.detail-meta { margin: 12px 0 20px; }
.macro-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.macro { border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; }
.macro strong { font-family: "Plus Jakarta Sans", Inter, sans-serif; font-size: 1.5rem; }
.macro span { color: var(--muted); font-size: .75rem; }
.macro-orange { background: #fff7ed; } .macro-green { background: var(--primary-soft); }
.macro-blue { background: #eff6ff; } .macro-yellow { background: #fefce8; }
.checklist { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.checklist label { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.checklist input { width: 20px; height: 20px; accent-color: var(--primary); }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; }
.steps-card { margin-top: 16px; }
.steps { margin: 12px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }

/* ---------- Daftar Belanja & Profil ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.page-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.page-actions form { margin: 0; }
.add-form { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.add-form[hidden] { display: none; }
.grow { flex: 1; min-width: 200px; }
select, .field select {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; background: var(--surface); color: var(--text);
}
.shop-grid { columns: 2; column-gap: 24px; }
.shop-group { break-inside: avoid; }
.shop-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.shop-head h3 { margin: 0; }
.shop-icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--muted-bg); }
.shop-icon-green { background: var(--primary-soft); } .shop-icon-orange { background: #fff7ed; }
.shop-icon-yellow { background: #fefce8; } .shop-icon-blue { background: #e0f2fe; }
.shop-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.shop-items li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.shop-items form { margin: 0; }
.shop-toggle { flex: 1; }
.shop-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 4px; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.shop-row-done span:last-child { color: var(--muted); text-decoration: line-through; }
.check-box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border); display: inline-flex; align-items: center; justify-content: center; flex: none; color: #fff; font-size: .8125rem; }
.check-box-on { background: var(--primary); border-color: var(--primary); }
.profile-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; margin-top: 24px; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head h2 { margin: 0 0 4px; font-size: 1.5rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.25rem; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-side .card, .profile-side .hero { margin: 0 0 24px; }
.hero-compact { position: relative; padding: 24px; border-radius: var(--radius-xl); color: #fff; background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.hero-compact h3 { color: #fff; }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; cursor: pointer; }
.switch-row small { display: block; }
.switch { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 999px; background: #cbd5e1; position: relative; cursor: pointer; transition: background .15s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(18px); }

/* ---------- Tema gelap ---------- */
:root[data-theme="dark"] {
  --text: #e2e8f0; --muted: #94a3b8; --border: #334155; --surface: #1e293b; --page: #0f172a; --muted-bg: #273449;
  --primary-soft: #14391f; --success-soft: #14391f; --warning-soft: #3b2a0a; --error-soft: #3b1414;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
:root[data-theme="dark"] .tip, :root[data-theme="dark"] .stat-icon-orange, :root[data-theme="dark"] .shop-icon-orange,
:root[data-theme="dark"] .macro-orange { background: #3b2410; }
:root[data-theme="dark"] .shop-icon-yellow, :root[data-theme="dark"] .macro-yellow { background: #3b3410; }
:root[data-theme="dark"] .stat-icon-blue, :root[data-theme="dark"] .shop-icon-blue, :root[data-theme="dark"] .macro-blue { background: #0c2a3d; }
:root[data-theme="dark"] .btn-light { background: #fff; color: var(--primary); }
:root[data-theme="dark"] .tag, :root[data-theme="dark"] .badge-done { color: #86efac; }

/* ---------- Profil (tampilan baru) ---------- */
.profile-hero {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 28px 32px; margin-bottom: 24px;
  border-radius: var(--radius-xl); color: #fff; background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: var(--shadow);
}
.avatar-xl { width: 88px; height: 88px; font-size: 2rem; background: rgba(255, 255, 255, .25); border: 3px solid rgba(255, 255, 255, .6); }
.profile-hero-text { flex: 1; min-width: 200px; }
.profile-hero-text h1 { color: #fff; margin: 0; font-size: 2rem; }
.profile-hero-text p { margin: 2px 0 10px; opacity: .9; }
.profile-stats { display: flex; gap: 12px; }
.profile-stats div { background: rgba(255, 255, 255, .18); border-radius: var(--radius-lg); padding: 12px 18px; text-align: center; min-width: 96px; }
.profile-stats strong { display: block; font-family: "Plus Jakarta Sans", Inter, sans-serif; font-size: 1.5rem; }
.profile-stats span { font-size: .75rem; opacity: .9; }
.profile-form { display: flex; flex-direction: column; gap: 0; }
.form-section h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 1.125rem; }
.section-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; }
.field-label { margin: 16px 0 8px; font-weight: 600; font-size: .875rem; }
.field-label:first-of-type { margin-top: 0; }
.option-grid-compact { grid-template-columns: repeat(2, 1fr); margin: 0; gap: 12px; }
.option-grid-compact .option { min-height: 0; padding: 14px 16px; }
.option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.option:has(input:checked) .option-title { color: var(--primary); }
.choice-chip { transition: background .15s, border-color .15s; }
.choice-chip:hover { border-color: #86efac; }
.save-bar {
  position: sticky; bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12); font-size: .875rem;
}
.regen-card { border-color: #bbf7d0; }
.regen-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 8px; }
.regen-head h3 { margin: 0 0 2px; }
.regen-head p { margin: 0; font-size: .875rem; }
.regen-form { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.regen-option { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--surface); }
.regen-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.regen-option input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--primary); }
.regen-option span { display: flex; flex-direction: column; }
.regen-option small { font-size: .8125rem; }
.regen-note { margin: 4px 0; font-size: .8125rem; color: var(--muted); }
.danger-zone { border-color: #fecaca; }

/* ---------- Asisten AI ---------- */
.page-chat { max-width: 860px; }
.chat { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; gap: 14px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.chat-sub { font-size: .8125rem; }
.chat-clear { margin: 0 0 0 auto; }
.chat-avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.chat-avatar-sm { width: 32px; height: 32px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.chat-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; height: 440px; overflow-y: auto; background: var(--page); }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg-user { justify-content: flex-end; }
.bubble-wrap { display: flex; flex-direction: column; gap: 8px; max-width: 80%; }
.msg-user .bubble-wrap { align-items: flex-end; }
.bubble { padding: 12px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); white-space: pre-line; max-width: 100%; }
.msg-user .bubble { background: var(--primary); border-color: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg-ai .bubble { border-top-left-radius: 4px; }
.msg-ai > .bubble { max-width: 80%; }
.bubble-action form { margin: 0; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 24px 0; }
.suggestions form { margin: 0; }
.suggestion { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .875rem; font-weight: 500; cursor: pointer; }
.suggestion:hover { border-color: var(--primary); color: var(--primary); }
.chat-input { display: flex; gap: 12px; padding: 16px 24px 4px; }
.chat-input input { flex: 1; padding: 14px 18px; border: 1px solid var(--border); border-radius: 999px; font: inherit; background: var(--surface); color: var(--text); }
.chat-input input:focus { border-color: var(--primary); outline: none; }
.chat-send { width: 48px; height: 48px; border-radius: 14px; border: 0; background: var(--primary); color: #fff; font-size: 1.125rem; cursor: pointer; }
.chat-send:hover { background: var(--primary-hover); }
.chat .hint { padding: 0 24px 16px; margin: 4px 0 0; }

@media (max-width: 960px) {
  .profile-stats { width: 100%; }
  .profile-stats div { flex: 1; }
  .option-grid-compact { grid-template-columns: 1fr; }
  .save-bar { flex-direction: column; align-items: stretch; text-align: center; }
  .profile-grid { grid-template-columns: 1fr; }
  .shop-grid { columns: 1; }
  .two-cols { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .macro-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-page { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body:has(.sidebar) { padding-left: 0; }
  .sidebar { position: static; width: auto; flex-direction: row; flex-wrap: wrap; padding: 12px 16px; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-nav .soon, .tip { display: none; }
  .topbar { padding: 12px 16px; }
  .hero-circle { display: none; }
  .user-name { display: none; }
  .page { padding: 20px 16px; }
  .grid-2, .option-grid, .stats, .choice-row { grid-template-columns: 1fr; }
  .stats-inline { grid-template-columns: 1fr; }
  .plan-item { flex-wrap: wrap; }
  .hero h2 { font-size: 2rem; }
}
