/* ═══════════════════════════════════════════════════════════════
   Portfolio — Design System
   Dark glassmorphism theme with micro-animations
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  --accent: #0b78d1;
  --accent-light: #6bd1ff;
  --accent-glow: rgba(11, 120, 209, 0.25);
  --bg-deep: #050d1a;
  --bg: #0a1628;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(107, 209, 255, 0.15);
  --text: #e6eef6;
  --text-secondary: #98a2b3;
  --text-muted: #5e6b7d;
  --glass: rgba(255, 255, 255, 0.04);
  --gradient-text: linear-gradient(135deg, #e6eef6 0%, #6bd1ff 50%, #0b78d1 100%);
  --gradient-accent: linear-gradient(135deg, #0b78d1, #6bd1ff);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(11, 120, 209, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --nav-height: 72px;
  --max-width: 1100px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ── Light Mode Tokens ──────────────────────────────────────── */
[data-theme="light"] {
  --accent: #0966b8;
  --accent-light: #0b78d1;
  --accent-glow: rgba(11, 120, 209, 0.15);
  --bg-deep: linen;
  --bg: #faf0e6;
  --bg-card: rgba(0, 0, 0, 0.03);
  --bg-card-hover: rgba(0, 0, 0, 0.06);
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(9, 102, 184, 0.2);
  --text: #1a1a2e;
  --text-secondary: #4a4a5a;
  --text-muted: #7a7a8a;
  --glass: rgba(0, 0, 0, 0.03);
  --gradient-text: linear-gradient(135deg, #1a1a2e 0%, #0b78d1 50%, #0966b8 100%);
  --gradient-accent: linear-gradient(135deg, #0966b8, #0b78d1);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 40px rgba(11, 120, 209, 0.06);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 1400px 700px at 10% 0%, rgba(11, 120, 209, 0.07), transparent),
    radial-gradient(ellipse 800px 400px at 90% 100%, rgba(107, 209, 255, 0.04), transparent),
    var(--bg-deep);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ── Navigation ─────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  background: var(--nav-bg, rgba(5, 13, 26, 0.75));
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.nav-inner {
  width: 100%;
  max-width: var(--max-width);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.5px;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-links a {
  position: relative;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover {
  color: var(--text);
  background: var(--glass);
}

.nav-links a.active {
  color: var(--accent-light);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition);
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--glass);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 18px;
  line-height: 1;
  margin-left: 4px;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: rotate(20deg) scale(1.05);
}

/* Light mode specific overrides */
[data-theme="light"] .nav {
  --nav-bg: rgba(250, 240, 230, 0.8);
}
[data-theme="light"] .tag {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--text-secondary);
}
[data-theme="light"] .edu-item {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, rgba(0,0,0,0.06) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
}
[data-theme="light"] .post-body code {
  background: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .hero-badge {
  background: rgba(11, 120, 209, 0.08);
  border-color: rgba(11, 120, 209, 0.15);
}

/* ── Page Shell ─────────────────────────────────────────────── */
.page {
  padding-top: calc(var(--nav-height) + 40px);
  padding-bottom: 80px;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Hero Section ───────────────────────────────────────────── */
.hero {
  padding: 80px 0 60px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-light);
  background: rgba(11, 120, 209, 0.1);
  border: 1px solid rgba(11, 120, 209, 0.2);
  border-radius: var(--radius-pill);
  margin-bottom: 24px;
  animation: fadeInDown 0.6s ease;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  background: #34d399;
  border-radius: 50%;
  animation: pulse-dot 2s ease infinite;
}

.jp-welcome {
  font-size: clamp(20px, 3.5vw, 28px);
  font-weight: 700;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #6bd1ff, #0b78d1, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 18px rgba(107, 209, 255, 0.35));
  margin-bottom: 18px;
  animation: fadeInDown 0.5s ease, jpGlow 3s ease-in-out infinite alternate;
}

@keyframes jpGlow {
  0%   { filter: drop-shadow(0 0 12px rgba(107, 209, 255, 0.25)); }
  100% { filter: drop-shadow(0 0 24px rgba(167, 139, 250, 0.4)); }
}

.hero h1 {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 20px;
  animation: fadeInUp 0.7s ease;
}

.hero h1 .gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 36px;
  animation: fadeInUp 0.8s ease;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.9s ease;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}
.btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--gradient-accent);
  border: none;
  color: #021a2b;
}
.btn-primary:hover {
  box-shadow: 0 8px 30px var(--accent-glow);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

/* ── Section Headers ────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.section-header .view-all {
  font-size: 14px;
  color: var(--accent-light);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--transition);
}
.section-header .view-all:hover {
  gap: 8px;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(107, 209, 255, 0.3), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.card:hover::before {
  opacity: 1;
}

/* ── Project Cards ──────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.project-card .project-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(11, 120, 209, 0.2), rgba(107, 209, 255, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
  border: 1px solid rgba(11, 120, 209, 0.15);
}

.project-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.project-card .project-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card .project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-card .project-link {
  font-size: 13px;
  color: var(--accent-light);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--transition);
}
.project-card .project-link:hover { gap: 8px; }

/* ── Tag Filter Bar ─────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--glass);
}
.filter-btn.active {
  background: var(--gradient-accent);
  border-color: transparent;
  color: #021a2b;
  font-weight: 600;
}

/* ── Blog Cards ─────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.blog-card {
  cursor: pointer;
}

.blog-card .blog-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.blog-card .blog-meta .date-pill {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(11, 120, 209, 0.1);
  color: var(--accent-light);
  font-weight: 500;
  font-size: 12px;
}

.blog-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
  transition: color var(--transition);
}

.blog-card:hover h3 { color: var(--accent-light); }

.blog-card .blog-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.blog-card .read-more {
  font-size: 13px;
  color: var(--accent-light);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--transition);
}
.blog-card:hover .read-more { gap: 8px; }

/* ── Tags ───────────────────────────────────────────────────── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* ── About Section (Home) ───────────────────────────────────── */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  margin-bottom: 60px;
}

.about-card p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.about-card p:last-child { margin-bottom: 0; }

.info-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-card {
  padding: 20px;
}

.info-card .info-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-card .info-title .icon {
  font-size: 16px;
}

/* Education items */
.edu-item {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  margin-bottom: 10px;
}
.edu-item:last-child { margin-bottom: 0; }
.edu-item strong { font-size: 14px; }
.edu-item .muted { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* Contact card */
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--gradient-accent);
  color: #021a2b;
  font-weight: 600;
  font-size: 14px;
  transition: all var(--transition);
}
.contact-email:hover {
  box-shadow: 0 8px 30px var(--accent-glow);
  transform: translateY(-1px);
}

.quick-links { display: flex; flex-direction: column; gap: 8px; }
.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--glass);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.quick-link:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

/* ── Blog Post Page ─────────────────────────────────────────── */
.post-container {
  max-width: 720px;
  margin: 0 auto;
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  transition: color var(--transition), gap var(--transition);
}
.post-back:hover { color: var(--accent-light); gap: 10px; }

.post-header {
  margin-bottom: 40px;
}

.post-header h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 16px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-muted);
}

.post-meta .separator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}

.post-body {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.post-body h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 40px 0 16px;
  letter-spacing: -0.3px;
}

.post-body p {
  margin-bottom: 20px;
}

.post-body em {
  color: var(--accent-light);
  font-style: italic;
}

.post-body code {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 15px;
}

/* ── Page Title (Projects/Blog pages) ───────────────────────── */
.page-title {
  padding: 40px 0 8px;
  margin-bottom: 32px;
}

.page-title h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.page-title p {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 520px;
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 80px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  color: var(--text-secondary);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--accent-light); }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.4); }
}

/* Scroll-triggered fade-in */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Loading state ──────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.06) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  min-height: 200px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 15px;
}
.empty-state .empty-icon {
  font-size: 40px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root { --nav-height: 64px; }

  .container { padding: 0 20px; }
  .hero { padding: 48px 0 40px; }
  .hero-subtitle { font-size: 16px; }

  /* Mobile nav */
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--nav-bg, rgba(5, 13, 26, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    transition: transform var(--transition);
    gap: 4px;
  }
  .nav-links.open {
    transform: translateY(0);
  }
  .nav-links a {
    padding: 12px 16px;
    width: 100%;
    border-radius: var(--radius-sm);
  }
  .nav-toggle { display: flex; }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Goals Calendar Styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Layout ─────────────────────────────────────────────────── */
.goals-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

/* ── Stats Row ──────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all var(--transition);
}
.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-total {
  font-size: 16px;
  font-weight: 500;
  -webkit-text-fill-color: var(--text-muted);
}
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.stat-bar {
  height: 4px;
  background: var(--glass);
  border-radius: 4px;
  margin-top: 10px;
  overflow: hidden;
}
.stat-fill {
  height: 100%;
  background: var(--gradient-accent);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ── Calendar Panel ─────────────────────────────────────────── */
.calendar-panel {
  padding: 24px;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.cal-header h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.cal-header-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cal-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.cal-nav-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.cal-today-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--accent-light);
  cursor: pointer;
  transition: all var(--transition);
}
.cal-today-btn:hover {
  background: var(--gradient-accent);
  color: #021a2b;
  border-color: transparent;
}

/* ── Calendar Grid ──────────────────────────────────────────── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day-header {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  border: 2px solid transparent;
  gap: 2px;
}
.cal-cell:hover:not(.cal-empty) {
  background: var(--bg-card-hover);
}
.cal-empty {
  cursor: default;
}

.cal-num {
  font-size: 14px;
  font-weight: 500;
}

.cal-dot-row {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-muted);
}

/* Calendar status colors */
.cal-complete { background: rgba(52, 211, 153, 0.1); }
.cal-complete .cal-num { color: #34d399; }
.cal-complete .cal-dot-row { color: #34d399; }

.cal-partial { background: rgba(251, 191, 36, 0.1); }
.cal-partial .cal-num { color: #fbbf24; }
.cal-partial .cal-dot-row { color: #fbbf24; }

.cal-pending { background: rgba(248, 113, 113, 0.08); }
.cal-pending .cal-num { color: #f87171; }
.cal-pending .cal-dot-row { color: #f87171; }

.cal-today {
  border-color: var(--accent) !important;
}
.cal-selected {
  background: rgba(11, 120, 209, 0.15) !important;
  border-color: var(--accent-light) !important;
}
.cal-selected .cal-num {
  color: var(--accent-light);
  font-weight: 700;
}

/* Calendar legend */
.cal-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.legend-complete { background: #34d399; }
.legend-partial { background: #fbbf24; }
.legend-pending { background: #f87171; }

/* ── Tasks Panel ────────────────────────────────────────────── */
.tasks-panel {
  display: flex;
  flex-direction: column;
}

.task-list-card {
  flex: 1;
  min-height: 200px;
}

/* Task form */
.add-task-form .form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.add-task-form .form-row:last-child {
  margin-bottom: 0;
}

.task-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}
.task-input:focus {
  border-color: var(--accent);
}
.task-input::placeholder {
  color: var(--text-muted);
}

.task-select {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}
.task-select option {
  background: var(--bg);
  color: var(--text);
}

/* Task items */
.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all var(--transition);
  margin-bottom: 8px;
}
.task-item:last-child { margin-bottom: 0; }
.task-item:hover {
  background: var(--glass);
  border-color: var(--border);
}

.task-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  color: transparent;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.task-check:hover {
  border-color: var(--accent);
}
.task-check.checked {
  background: var(--gradient-accent);
  border-color: transparent;
  color: #fff;
}

.task-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.task-text {
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
}

.task-done .task-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-priority {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.task-priority-high { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.task-priority-medium { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.task-priority-low { background: rgba(52, 211, 153, 0.15); color: #34d399; }

.task-delete {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transition: all var(--transition);
}
.task-item:hover .task-delete { opacity: 1; }
.task-delete:hover {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

/* Task empty state */
.task-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
}
.task-empty-icon {
  font-size: 32px;
  margin-bottom: 10px;
  opacity: 0.5;
}

/* ── Goals Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
  .goals-layout {
    grid-template-columns: 1fr;
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-value {
    font-size: 22px;
  }
  .cal-cell {
    aspect-ratio: auto;
    min-height: 40px;
  }
  .cal-dot-row {
    font-size: 8px;
  }
}
