:root {
  --bg:         #0d0f14;
  --bg-card:    #14171f;
  --bg-input:   #1a1d27;
  --border:     #252836;
  --accent:     #7c6bff;
  --accent-2:   #00e5b0;
  --accent-3:   #ff6b6b;
  --text:       #e8eaf0;
  --text-muted: #6b7280;
  --text-dim:   #3d4259;
  --font-head:  'Syne', sans-serif;
  --font-mono:  'DM Mono', monospace;
  --radius:     12px;
  --radius-lg:  18px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 60px;
  background: rgba(13, 15, 20, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 800; font-size: 1.1rem;
}
.brand-icon { font-size: 1.3rem; color: var(--accent); }
.nav-links { display: flex; list-style: none; gap: 0.25rem; }
.nav-link {
  display: block; padding: 6px 14px; border-radius: 8px;
  color: var(--text-muted); text-decoration: none;
  font-family: var(--font-mono); font-size: 0.82rem;
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active { background: var(--bg-input); color: var(--text); }
.nav-link.active { color: var(--accent); }

.container { max-width: 1100px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.section { animation: fadeUp 0.4s ease both; }
.hidden { display: none !important; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-header { margin-bottom: 2rem; }
.section-title { font-family: var(--font-head); font-size: 2rem; font-weight: 800; }
.section-sub { margin-top: 4px; color: var(--text-muted); font-size: 0.85rem; }

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.4rem 1.6rem;
  position: relative; overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.card-streak::before  { background: linear-gradient(90deg, #ff6b6b, #ffb347); }
.card-today::before   { background: linear-gradient(90deg, var(--accent), #a78bfa); }
.card-sessions::before{ background: linear-gradient(90deg, var(--accent-2), #3ecfb2); }
.card-goal::before    { background: linear-gradient(90deg, #60a5fa, #38bdf8); }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,0.3); }
.stat-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem; }
.stat-value { font-family: var(--font-head); font-size: 2.4rem; font-weight: 800; line-height: 1; }
.stat-unit { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

.goal-bar-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem 1.6rem; margin-bottom: 1.5rem;
}
.goal-bar-label { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.goal-bar-track { height: 8px; background: var(--bg-input); border-radius: 999px; overflow: hidden; }
.goal-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px; width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.recent-section { margin-top: 1.5rem; }
.sub-heading { font-family: var(--font-head); font-size: 1rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 1rem; }
.sessions-list { display: flex; flex-direction: column; gap: 0.75rem; }
.session-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.2rem;
  display: flex; justify-content: space-between; align-items: center;
  animation: fadeUp 0.3s ease both; transition: border-color var(--transition);
}
.session-item:hover { border-color: var(--accent); }
.session-subject { font-family: var(--font-head); font-size: 0.95rem; font-weight: 700; }
.session-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.session-right { display: flex; align-items: center; gap: 1rem; }
.session-duration { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; color: var(--accent-2); }
.btn-delete {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  border-radius: 6px; padding: 4px 10px; cursor: pointer;
  font-size: 0.75rem; font-family: var(--font-mono); transition: var(--transition);
}
.btn-delete:hover { border-color: var(--accent-3); color: var(--accent-3); }
.empty-state {
  color: var(--text-muted); font-size: 0.85rem; padding: 2rem; text-align: center;
  background: var(--bg-card); border: 1px dashed var(--border); border-radius: var(--radius);
}

.form-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem; max-width: 600px;
}
.form-group { margin-bottom: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-label { display: block; font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.4rem; }
.required { color: var(--accent); }
.optional { color: var(--text-dim); font-size: 0.7rem; }
.form-input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.7rem 0.9rem; color: var(--text);
  font-family: var(--font-mono); font-size: 0.88rem; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 107, 255, 0.15); }
.form-input.error { border-color: var(--accent-3); }
.form-textarea { resize: vertical; min-height: 90px; }
.error-msg { display: block; font-size: 0.72rem; color: var(--accent-3); margin-top: 4px; min-height: 16px; }

.btn-primary {
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 0.75rem 1.6rem; font-family: var(--font-head); font-weight: 700;
  font-size: 0.9rem; cursor: pointer; letter-spacing: 0.02em;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn-primary:hover { background: #6b5ce7; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124, 107, 255, 0.35); }
.btn-primary:active { transform: translateY(0); }
.current-goal-display { margin-top: 1rem; font-size: 0.8rem; color: var(--accent-2); }

.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.chart-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
.chart-title { font-family: var(--font-head); font-size: 0.88rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 1.2rem; }

.toast {
  position: fixed; bottom: 2rem; right: 2rem;
  background: var(--bg-card); border: 1px solid var(--accent); color: var(--text);
  padding: 0.85rem 1.4rem; border-radius: var(--radius);
  font-size: 0.85rem; font-family: var(--font-mono);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none; z-index: 999; max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .navbar { padding: 0 1rem; }
  .nav-link { padding: 6px 10px; font-size: 0.75rem; }
  .section-title { font-size: 1.5rem; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}
