/* ─── Fonts ─────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Mono:wght@400;500&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ─── Design Tokens ──────────────────────── */
:root {
  --accent: #e85d26;
  --accent-hover: #cf4e1c;
  --accent-muted: rgba(232, 93, 38, 0.12);
  --accent-glow: rgba(232, 93, 38, 0.25);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --transition: 0.18s ease;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.15);
  --shadow: 0 4px 16px rgba(0,0,0,0.2);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.3);

  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
}

[data-theme="dark"] {
  --bg: #0e0e0f;
  --bg-2: #161618;
  --bg-3: #1f1f22;
  --bg-4: #2a2a2e;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.15);
  --text: #f0f0f0;
  --text-2: #a0a0a8;
  --text-3: #5c5c66;
  --card-bg: #161618;
  --card-hover: #1f1f22;
  --overlay: rgba(0,0,0,0.7);
  --header-bg: rgba(14,14,15,0.92);
  --input-bg: #1f1f22;
  --input-border: rgba(255,255,255,0.08);
}

[data-theme="light"] {
  --bg: #f8f7f5;
  --bg-2: #ffffff;
  --bg-3: #f2f1ef;
  --bg-4: #e8e7e4;
  --border: rgba(0,0,0,0.07);
  --border-hover: rgba(0,0,0,0.15);
  --text: #1a1a1c;
  --text-2: #5c5c66;
  --text-3: #9a9aa4;
  --card-bg: #ffffff;
  --card-hover: #f8f7f5;
  --overlay: rgba(0,0,0,0.5);
  --header-bg: rgba(248,247,245,0.92);
  --input-bg: #f2f1ef;
  --input-border: rgba(0,0,0,0.08);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.15);
}

/* ─── Reset & Base ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); }
input, textarea, select {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
}
img { max-width: 100%; display: block; }

.hidden { display: none !important; }

/* ─── Header ─────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  flex-shrink: 0;
}
.header-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}
.nav-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: all var(--transition);
}
.nav-btn:hover { color: var(--text); background: var(--bg-3); }
.nav-btn.active { color: var(--text); background: var(--bg-3); }

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: all var(--transition);
}
.theme-toggle:hover { background: var(--bg-3); color: var(--text); }
.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

/* ─── User Menu ──────────────────────────── */
#user-menu { position: relative; }
.user-avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  transition: border-color var(--transition);
}
.user-avatar-btn:hover { border-color: var(--accent); }
.user-avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  overflow: hidden;
  z-index: 200;
}
.user-dropdown a {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-2);
  transition: all var(--transition);
}
.user-dropdown a:hover { color: var(--text); background: var(--bg-3); }
.dropdown-divider { border-top: 1px solid var(--border); margin: 4px 0; }

/* ─── Buttons ────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-primary.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius); }

.btn-ghost {
  color: var(--text-2);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-hover); background: var(--bg-3); }

.btn-danger {
  background: rgba(239,68,68,0.12);
  color: var(--danger);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
}
.btn-danger:hover { background: var(--danger); color: white; }

.btn-success {
  background: rgba(34,197,94,0.12);
  color: var(--success);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
}
.btn-success:hover { background: var(--success); color: white; }

/* ─── Pages ──────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

#main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 100px;
}

/* ─── Hero ───────────────────────────────── */
.hero-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  padding: 48px 0 56px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}
.hero-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 20px;
  font-family: var(--font-mono);
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}
.hero-sub {
  color: var(--text-2);
  font-size: 17px;
  max-width: 400px;
  margin-bottom: 28px;
  line-height: 1.6;
}
.hero-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 28px;
  text-align: center;
  min-width: 140px;
}
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

/* ─── Feed ───────────────────────────────── */
.feed-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
}
.feed-tabs, .admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.tab-btn {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-2); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ─── Log Cards ──────────────────────────── */
.log-list { display: flex; flex-direction: column; gap: 16px; }

.log-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.log-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--transition);
}
.log-card:hover {
  border-color: var(--border-hover);
  background: var(--card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.log-card:hover::before { opacity: 1; }

.log-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.log-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-3);
}
.log-avatar-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.log-meta { flex: 1; min-width: 0; }
.log-author { font-weight: 600; font-size: 14px; color: var(--text); }
.log-project-name {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  font-family: var(--font-mono);
}
.log-date { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.log-day-badge {
  background: var(--bg-3);
  color: var(--text-3);
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 4px 10px;
  border-radius: 100px;
  flex-shrink: 0;
}
.log-day-badge.milestone {
  background: rgba(232,93,38,0.15);
  color: var(--accent);
}
.log-content {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.log-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.log-mood { font-size: 16px; }
.log-reactions { display: flex; gap: 6px; flex: 1; }
.reaction-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 100px;
  font-size: 12px;
  color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid transparent;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.reaction-btn:hover, .reaction-btn.active { background: var(--accent-muted); color: var(--accent); border-color: var(--accent-glow); }
.reaction-btn .reaction-label { font-size: 11px; }
.log-comments-count {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
}
.milestone-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(232,93,38,0.15), rgba(251,191,36,0.15));
  border: 1px solid rgba(232,93,38,0.3);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
}

/* ─── Sidebar ────────────────────────────── */
.feed-sidebar { display: flex; flex-direction: column; gap: 24px; }
.sidebar-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.sidebar-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.builder-item, .project-item-sm {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.builder-item:last-child, .project-item-sm:last-child { border-bottom: none; }
.builder-item:hover, .project-item-sm:hover { opacity: 0.8; }
.builder-avatar-sm {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-3); object-fit: cover; flex-shrink: 0;
}
.builder-avatar-placeholder-sm {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-muted); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.builder-name { font-size: 13px; font-weight: 600; color: var(--text); }
.builder-meta { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }
.builder-streak {
  margin-left: auto;
  font-size: 11px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
}

/* ─── Explore Grid ───────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-sub { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  padding: 7px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  border: 1px solid var(--border);
  transition: all var(--transition);
  background: transparent;
}
.filter-btn:hover { color: var(--text); border-color: var(--border-hover); }
.filter-btn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-muted); }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.project-card:hover {
  border-color: var(--border-hover);
  background: var(--card-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.project-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.project-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-3);
  color: var(--text-2);
  font-family: var(--font-mono);
}
.private-badge {
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-3);
}
.project-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.project-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-stats {
  display: flex;
  gap: 16px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.project-stat { font-size: 12px; color: var(--text-3); }
.project-stat strong { color: var(--text); font-weight: 600; }
.project-creator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}

/* ─── Dashboard ──────────────────────────── */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.streak-banner {
  background: linear-gradient(135deg, rgba(232,93,38,0.08), rgba(251,191,36,0.06));
  border: 1px solid rgba(232,93,38,0.2);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}
.streak-flame { font-size: 36px; }
.streak-num {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.streak-label { font-size: 13px; color: var(--text-3); }
.streak-calendar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
  margin-left: auto;
}
.streak-day {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: var(--bg-3);
  transition: all var(--transition);
}
.streak-day.logged { background: var(--accent); }
.streak-day.today { background: var(--accent); box-shadow: 0 0 6px var(--accent-glow); }

/* ─── Project Detail ─────────────────────── */
.project-detail-hero {
  padding: 32px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.project-detail-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.project-detail-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.project-detail-desc { font-size: 16px; color: var(--text-2); max-width: 600px; line-height: 1.6; }
.project-detail-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.follow-btn {
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all var(--transition);
}
.follow-btn:hover, .follow-btn.following { background: var(--accent); color: white; border-color: var(--accent); }

.project-timeline { display: flex; flex-direction: column; gap: 24px; }
.timeline-entry {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
}
.timeline-day-col { text-align: right; }
.timeline-day-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-3);
  display: block;
  padding-top: 4px;
}
.timeline-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-4);
  border: 2px solid var(--border);
  flex-shrink: 0;
  margin-top: 5px;
  transition: all var(--transition);
}
.timeline-dot.milestone-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.timeline-line {
  width: 1px;
  flex: 1;
  background: var(--border);
  margin-top: 4px;
}

/* ─── Project Analytics ──────────────────── */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.analytics-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.analytics-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}
.analytics-label { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }

/* ─── Comments ───────────────────────────── */
.comments-section { margin-top: 24px; }
.comments-title { font-weight: 700; font-size: 15px; margin-bottom: 14px; color: var(--text); }
.comment-item {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-body { flex: 1; }
.comment-author { font-weight: 600; font-size: 13px; }
.comment-text { font-size: 13px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }
.comment-time { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.comment-input-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.comment-input {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
  color: var(--text);
}
.comment-input:focus { border-color: var(--accent); }

/* ─── Profile ────────────────────────────── */
.profile-hero {
  padding: 32px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.profile-info {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-3);
}
.profile-avatar-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 28px;
}
.profile-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.profile-stats { display: flex; gap: 24px; margin-top: 12px; }
.profile-stat-num { font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.profile-stat-label { font-size: 12px; color: var(--text-3); }

/* ─── Auth Modal ─────────────────────────── */
#auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
}
.auth-modal {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}
.auth-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.auth-sub { color: var(--text-2); font-size: 14px; margin-bottom: 28px; }
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  margin-bottom: 20px;
}
.btn-google:hover { border-color: var(--border-hover); background: var(--bg-3); }
.auth-divider {
  text-align: center;
  position: relative;
  margin-bottom: 20px;
}
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}
.auth-divider span {
  position: relative;
  background: var(--card-bg);
  padding: 0 12px;
  font-size: 12px;
  color: var(--text-3);
}
.auth-email-form { display: flex; flex-direction: column; gap: 10px; }
.auth-actions { display: flex; gap: 10px; }
.auth-actions .btn-primary { flex: 1; text-align: center; }
.auth-actions .btn-ghost { flex: 1; text-align: center; }
.btn-close-auth {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 14px;
  transition: all var(--transition);
}
.btn-close-auth:hover { background: var(--bg-3); color: var(--text); }

/* ─── Modals ─────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
}
.modal {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.modal.modal-lg { max-width: 600px; }
.modal-header {
  padding: 24px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-header h3 { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 14px;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--bg-3); color: var(--text); }
.modal-body { padding: 0 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer {
  padding: 20px 24px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}
.log-day-label {
  margin-right: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

/* ─── Form Fields ────────────────────────── */
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: -8px;
}
.optional { font-weight: 400; text-transform: none; letter-spacing: 0; }
.field-input, .field-textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}
.field-input:focus, .field-textarea:focus { border-color: var(--accent); }
.field-textarea { resize: vertical; min-height: 100px; }
.field-input::placeholder, .field-textarea::placeholder { color: var(--text-3); }

/* Type pills */
.type-pills, .mood-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.type-pill, .mood-pill {
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: transparent;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.type-pill:hover, .mood-pill:hover { border-color: var(--accent); color: var(--accent); }
.type-pill.active, .mood-pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-muted);
}

/* Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-2);
}
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-4);
  border-radius: 100px;
  transition: all 0.3s;
  cursor: pointer;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s;
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ─── Badges ─────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}
.badge-admin { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-public { background: rgba(34,197,94,0.12); color: var(--success); }
.badge-private { background: var(--bg-3); color: var(--text-3); }

/* ─── Admin ──────────────────────────────── */
.admin-panel-section { display: flex; flex-direction: column; gap: 16px; }
.report-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.report-card.flagged { border-color: rgba(239,68,68,0.3); }
.report-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.report-type { font-size: 12px; color: var(--danger); font-weight: 600; font-family: var(--font-mono); }
.report-reason { font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.report-actions { display: flex; gap: 8px; }

/* ─── FAB ────────────────────────────────── */
.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: all 0.2s ease;
  z-index: 90;
}
.fab:hover { background: var(--accent-hover); transform: scale(1.08); box-shadow: 0 6px 24px var(--accent-glow); }

/* ─── Toast ──────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
  max-width: 300px;
}
.toast.success { border-color: rgba(34,197,94,0.4); }
.toast.error { border-color: rgba(239,68,68,0.4); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── States ─────────────────────────────── */
.loading-state, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
  color: var(--text-3);
  text-align: center;
}
.empty-icon { font-size: 40px; }
.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Report button ──────────────────────── */
.btn-report {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-3);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.btn-report:hover { color: var(--danger); background: rgba(239,68,68,0.08); }

/* ─── Mobile ─────────────────────────────── */
@media (max-width: 768px) {
  .hero-section {
    flex-direction: column;
    padding: 32px 0 40px;
  }
  .hero-stats {
    flex-direction: row;
    width: 100%;
  }
  .stat-card { flex: 1; padding: 14px; }
  .stat-num { font-size: 22px; }
  .feed-layout { grid-template-columns: 1fr; }
  .feed-sidebar { display: none; }
  .header-nav { display: none; }
  .logo span { display: block; }
  .project-grid { grid-template-columns: 1fr; }
  .timeline-entry { grid-template-columns: 60px 1fr; }
  .analytics-grid { grid-template-columns: repeat(2, 1fr); }
  #main-content { padding: 20px 16px 90px; }
  .auth-modal { padding: 28px 24px; }
  .streak-calendar { display: none; }
  .dashboard-header { flex-direction: column; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 30px; }
  .hero-stats { gap: 8px; }
  .modal { border-radius: var(--radius-lg); }
  .log-reactions { flex-wrap: wrap; }
}

/* ─── Scrollbar ──────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }
