/* ===== FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&family=Lora:wght@400;500;600;700&display=swap');

/* ===== DARK MODE (default) ===== */
:root {
  --bg: #0c0c14;
  --surface: #13131f;
  --card: #18182a;
  --card2: #1e1e30;
  --border: #2a2a40;
  --border2: #353550;
  --accent: #00e887;
  --accent2: #ff7043;
  --accent3: #8b5cf6;
  --accent4: #22d3ee;
  --accent5: #f59e0b;
  --text: #f0f0fa;
  --text2: #c8c8e0;
  --muted: #707090;
  --muted2: #505070;
  --danger: #f43f5e;
  --success: #00e887;
  --warning: #f59e0b;
  --glow: rgba(0,232,135,0.12);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
}

/* ===== LIGHT MODE ===== */
[data-theme="light"] {
  --bg: #f4f4f8;
  --surface: #ffffff;
  --card: #ffffff;
  --card2: #f8f8fc;
  --border: #e2e2ee;
  --border2: #d0d0e4;
  --accent: #00a85a;
  --accent2: #e64a19;
  --accent3: #6d28d9;
  --accent4: #0891b2;
  --accent5: #d97706;
  --text: #111128;
  --text2: #2d2d50;
  --muted: #6b6b90;
  --muted2: #9090b0;
  --danger: #e11d48;
  --success: #00a85a;
  --warning: #d97706;
  --glow: rgba(0,168,90,0.08);
  --shadow: 0 2px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

/* ===== BACKGROUND AMBIENT ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 500px at 10% 10%, rgba(0,232,135,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 600px 400px at 90% 80%, rgba(139,92,246,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 600px 400px at 10% 10%, rgba(0,168,90,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 500px 300px at 90% 80%, rgba(109,40,217,0.04) 0%, transparent 70%);
}

/* ===== LAYOUT ===== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  position: relative;
  z-index: 1;
}

/* ===== TOPBAR ===== */
.topbar {
  position: sticky; top: 0; z-index: 200;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: background 0.3s, border-color 0.3s;
}
[data-theme="light"] .topbar {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 16px;
  display: flex; align-items: center;
  height: 56px; gap: 12px;
}
.logo {
  font-family: 'Lora', serif;
  font-weight: 700; font-size: 20px;
  color: var(--text); letter-spacing: -0.5px;
  white-space: nowrap;
}
.logo em { font-style: normal; color: var(--accent); }

/* ===== BOTTOM NAV (mobile) ===== */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
  grid-template-columns: repeat(7, 1fr);
}
.bnav-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 4px 2px;
  font-size: 9px; color: var(--muted);
  cursor: pointer; transition: color 0.2s;
  border: none; background: none;
}
.bnav-item .icon { font-size: 18px; }
.bnav-item.active { color: var(--accent); }

/* ===== DESKTOP NAV ===== */
.desk-nav {
  display: flex; align-items: center; gap: 2px;
  flex: 1; overflow-x: auto;
  scrollbar-width: none;
}
.desk-nav::-webkit-scrollbar { display: none; }
.desk-nav a {
  white-space: nowrap;
  padding: 6px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--muted); text-decoration: none;
  transition: all 0.2s; cursor: pointer;
}
.desk-nav a.active, .desk-nav a:hover { color: var(--accent); background: var(--glow); }

/* NAV RIGHT */
.nav-right {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.streak-pill {
  background: linear-gradient(135deg, #ff7043, #f59e0b);
  color: #fff; border-radius: 20px;
  padding: 3px 10px; font-size: 12px; font-weight: 700;
  white-space: nowrap;
}
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card); color: var(--text2);
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ===== CARDS ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-sm { padding: 14px 16px; border-radius: 12px; }
.card-accent-green { border-left: 3px solid var(--accent); }
.card-accent-orange { border-left: 3px solid var(--accent2); }
.card-accent-purple { border-left: 3px solid var(--accent3); }
.card-accent-cyan { border-left: 3px solid var(--accent4); }
.card-accent-amber { border-left: 3px solid var(--accent5); }

/* ===== SECTION TITLES ===== */
.section-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.section-title {
  font-family: 'Lora', serif;
  font-weight: 700; font-size: 20px;
  color: var(--text); letter-spacing: -0.3px;
}
.section-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--muted);
}

/* ===== METRIC CARDS ===== */
.metric-value {
  font-family: 'Outfit', sans-serif;
  font-size: 30px; font-weight: 800;
  color: var(--text); line-height: 1;
}
.metric-unit { font-size: 14px; font-weight: 400; color: var(--muted); }
.metric-label {
  font-size: 11px; font-weight: 600; letter-spacing: 1.5px;
  color: var(--muted); margin-top: 6px;
  text-transform: uppercase;
}
.metric-icon { font-size: 22px; margin-bottom: 8px; }

/* ===== PROGRESS ===== */
.progress-bar {
  height: 5px; background: var(--border2);
  border-radius: 3px; overflow: hidden; margin-top: 8px;
}
.progress-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}
.p-green { background: var(--accent); }
.p-orange { background: var(--accent2); }
.p-purple { background: var(--accent3); }
.p-cyan { background: var(--accent4); }
.p-amber { background: var(--accent5); }

/* ===== GRID ===== */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.g3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.g4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.gmain { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.gside { display: flex; flex-direction: column; gap: 14px; }

/* ===== CHECKLIST ===== */
.checklist { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.cl-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px;
  background: var(--card2); border: 1px solid transparent;
  cursor: pointer; transition: all 0.2s; font-size: 14px;
}
.cl-item:hover { border-color: var(--border); }
.cl-item.done { background: var(--glow); border-color: rgba(0,232,135,0.2); }
.cl-item.done .cl-text { color: var(--muted); text-decoration: line-through; }
.cl-box {
  width: 20px; height: 20px; flex-shrink: 0;
  border-radius: 5px; border: 1.5px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; transition: all 0.2s;
}
.cl-item.done .cl-box {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
[data-theme="light"] .cl-item.done .cl-box { color: #000; }
.cl-tag {
  font-size: 10px; padding: 2px 7px; border-radius: 8px;
  font-weight: 600; letter-spacing: 0.3px; white-space: nowrap;
}
.tag-body { background: rgba(0,232,135,0.12); color: var(--accent); }
.tag-mind { background: rgba(139,92,246,0.12); color: var(--accent3); }
.tag-sleep { background: rgba(34,211,238,0.12); color: var(--accent4); }
.tag-food { background: rgba(245,158,11,0.12); color: var(--accent5); }
.tag-suppl { background: rgba(255,112,67,0.12); color: var(--accent2); }
.cl-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--muted);
  margin-left: auto; white-space: nowrap;
}

/* ===== FORMS ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
label {
  font-size: 11px; font-weight: 600;
  color: var(--muted); letter-spacing: 1px; text-transform: uppercase;
}
input[type=number], input[type=text], input[type=date], textarea, select {
  background: var(--card2); border: 1.5px solid var(--border);
  border-radius: 9px; color: var(--text);
  padding: 10px 13px; font-size: 14px;
  font-family: 'Outfit', sans-serif;
  outline: none; transition: border-color 0.2s, background 0.2s;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  background: var(--card);
}
textarea { resize: vertical; min-height: 80px; }
.range-wrap { display: flex; align-items: center; gap: 10px; }
input[type=range] {
  flex: 1; -webkit-appearance: none; background: transparent;
  padding: 0; border: none;
}
input[type=range]::-webkit-slider-track {
  height: 4px; background: var(--border2); border-radius: 2px;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); cursor: pointer; margin-top: -6px;
}
.range-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px; color: var(--accent); min-width: 24px; text-align: right;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 11px 22px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.2s;
  font-family: 'Outfit', sans-serif;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text2); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 7px 14px; font-size: 12px; }

/* ===== BADGES ===== */
.badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 6px; letter-spacing: 0.5px;
}
.badge-green { background: rgba(0,232,135,0.12); color: var(--accent); }
.badge-red { background: rgba(244,63,94,0.12); color: var(--danger); }
.badge-amber { background: rgba(245,158,11,0.12); color: var(--accent5); }
.badge-muted { background: rgba(112,112,144,0.15); color: var(--muted); }

/* ===== ALERT ===== */
.alert {
  padding: 14px 18px; border-radius: 12px;
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 14px; margin-bottom: 20px;
  border: 1px solid;
}
.alert-warning { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.25); color: var(--text2); }
.alert-danger { background: rgba(244,63,94,0.08); border-color: rgba(244,63,94,0.25); color: var(--text2); }
.alert-success { background: rgba(0,232,135,0.08); border-color: rgba(0,232,135,0.25); color: var(--text2); }
.alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

/* ===== TABS ===== */
.tabs {
  display: flex; gap: 4px;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px; margin-bottom: 20px;
}
.tab {
  flex: 1; padding: 9px 12px; border-radius: 8px;
  text-align: center; cursor: pointer; font-size: 13px;
  font-weight: 500; transition: all 0.2s; color: var(--muted);
  border: none; background: none;
}
.tab.active { background: var(--accent); color: #000; font-weight: 700; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ===== TABLES ===== */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; padding: 10px 12px;
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  color: var(--muted); text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--border); color: var(--text2); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--card2); }

/* ===== VITAMIN LIST ===== */
.vit-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--card2); border: 1px solid transparent;
  margin-bottom: 6px; transition: all 0.2s;
}
.vit-item:hover { border-color: var(--border); }
.vit-icon { font-size: 22px; flex-shrink: 0; }
.vit-name { font-size: 14px; font-weight: 600; }
.vit-why { font-size: 12px; color: var(--muted); margin-top: 2px; }
.vit-dose {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--accent); white-space: nowrap;
}
.vit-when {
  font-size: 11px; color: var(--muted);
  background: var(--card); padding: 3px 9px; border-radius: 8px;
  white-space: nowrap; border: 1px solid var(--border);
}

/* ===== MEASURE GRID ===== */
.measure-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 28px; }
.measure-item {
  padding: 14px; background: var(--card2);
  border: 1px solid var(--border); border-radius: 12px;
}
.measure-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.measure-detail { font-size: 12px; color: var(--muted); line-height: 1.5; }
.measure-tool { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--accent4); margin-top: 8px; }

/* ===== PRIORITY BADGE ===== */
.pri { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px; margin-bottom: 5px; letter-spacing: 0.3px; }
.pri-high { background: rgba(244,63,94,0.12); color: var(--danger); }
.pri-med { background: rgba(245,158,11,0.12); color: var(--accent5); }
.pri-low { background: rgba(112,112,144,0.12); color: var(--muted); }

/* ===== MEAL SLOT ===== */
.meal-slot {
  display: grid; grid-template-columns: 100px 1fr auto;
  gap: 12px; padding: 13px 0;
  border-bottom: 1px solid var(--border); align-items: start;
}
.meal-time { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--accent4); }
.meal-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.meal-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }
.meal-macro { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); text-align: right; white-space: nowrap; }

/* ===== ANTI-AGING ===== */
.tip-card {
  padding: 15px; background: var(--card2);
  border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px;
}
.tip-title { font-size: 14px; font-weight: 700; margin-bottom: 5px; }
.tip-body { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ===== DIVIDER ===== */
.divider { height: 1px; background: var(--border); margin: 28px 0; }

/* ===== PAGE SECTION ===== */
.page-section { padding: 24px 0 48px; }

/* ===== ANIMATIONS ===== */
.fade-in { animation: fadeUp 0.45s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.12s; }
.d3 { animation-delay: 0.2s; }
.d4 { animation-delay: 0.28s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .gmain { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: 1fr 1fr; }
  .g3 { grid-template-columns: 1fr 1fr; }
  .measure-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .desk-nav { display: none; }
  .bottom-nav { display: grid; }
  .topbar-inner { height: 50px; }
  body { padding-bottom: 70px; }

  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .measure-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .tabs { flex-wrap: wrap; }
  .tab { min-width: 45%; }
  .meal-slot { grid-template-columns: 85px 1fr; }
  .meal-macro { grid-column: 2; }
  .section-title { font-size: 18px; }
  .logo { font-size: 17px; }
  .streak-pill { font-size: 11px; }
  .metric-value { font-size: 26px; }
  .card { padding: 16px; }

  /* Current activity hero — mobile */
  .now-card-inner { flex-direction: column; gap: 12px; }
}
