:root {
  --primary: #74B9FF;
  --primary-dim: rgba(116,185,255,0.12);
  --secondary: #A29BFE;
  --accent: #FDCB6E;
  --accent-dim: rgba(253,203,110,0.12);
  --bg: #0A1219;
  --bg-card: rgba(10,18,25,0.85);
  --bg-input: rgba(6,12,18,0.9);
  --border: rgba(116,185,255,0.12);
  --border-hover: rgba(116,185,255,0.25);
  --text: #E2E8F0;
  --text-dim: #94A3B8;
  --text-muted: #64748B;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --transition: 250ms ease;
  --glass: rgba(10,18,25,0.65);
  --glass-border: rgba(116,185,255,0.08);
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  min-height: 100vh; line-height: 1.6;
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(116,185,255,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(253,203,110,0.03) 0%, transparent 50%);
}
.app { max-width: 1300px; margin: 0 auto; padding: 0 24px; display: flex; flex-direction: column; min-height: 100vh; }

.header { padding: 16px 0; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.header-left { display: flex; align-items: center; gap: 12px; }
.logo { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.header h1 { font-size: 1.2rem; font-weight: 700; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.streak-badge { padding: 6px 12px; background: var(--accent-dim); border: 1px solid rgba(253,203,110,0.2); border-radius: 20px; font-size: 0.82rem; font-weight: 600; color: var(--accent); }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: var(--radius-sm); border: none; font-family: var(--font); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all var(--transition); white-space: nowrap; }
.btn-primary { background: var(--primary); color: #0A1219; }
.btn-primary:hover { background: #5EAAFF; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); background: var(--primary-dim); }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }

.main { flex: 1; display: grid; grid-template-columns: 260px 1fr; gap: 16px; padding: 16px 0; align-items: start; }

.panel { background: var(--glass); backdrop-filter: blur(12px); border: 1px solid var(--glass-border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; animation: fadeIn 0.3s ease; }
.panel-header { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.panel-header h2 { font-size: 0.88rem; font-weight: 600; }
.panel-body { padding: 16px; flex: 1; overflow-y: auto; max-height: calc(100vh - 160px); }

.input { width: 100%; padding: 8px 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-family: var(--font); font-size: 0.82rem; outline: none; transition: all var(--transition); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }
.input-sm { padding: 5px 8px; font-size: 0.78rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.section-title { font-size: 0.78rem; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; }
.empty-msg { font-size: 0.78rem; color: var(--text-muted); padding: 10px 0; }

/* History */
.history-list { margin-top: 10px; }
.history-item { padding: 8px; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--transition); margin-bottom: 4px; border: 1px solid transparent; }
.history-item:hover { background: var(--primary-dim); }
.history-item.active { border-color: var(--primary); background: var(--primary-dim); }
.history-item .hi-date { font-size: 0.78rem; font-weight: 600; }
.history-item .hi-mood { font-size: 0.7rem; color: var(--text-dim); }

/* Habits */
.habits-list { margin-bottom: 8px; }
.habit-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 0.82rem; }
.habit-item input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; }
.habit-item .habit-name { flex: 1; }
.habit-item .remove-habit { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.7rem; padding: 2px 4px; }
.habit-item .remove-habit:hover { color: var(--danger); }
.add-habit-row, .add-goal-row { display: flex; gap: 6px; margin-top: 4px; }
.add-habit-row .input, .add-goal-row .input { flex: 1; }

/* Mood */
.meta-row { display: flex; gap: 16px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.mood-selector { display: flex; align-items: center; gap: 4px; }
.mood-label { font-size: 0.72rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; margin-right: 4px; }
.mood-btn { background: none; border: 2px solid transparent; cursor: pointer; font-size: 1.2rem; padding: 4px; border-radius: 8px; transition: all var(--transition); opacity: 0.5; }
.mood-btn:hover, .mood-btn.active { opacity: 1; border-color: var(--accent); transform: scale(1.15); }
.energy-bar { display: flex; align-items: center; gap: 6px; }
.slider-input { -webkit-appearance: none; width: 80px; height: 4px; border-radius: 2px; background: var(--border-hover); outline: none; cursor: pointer; }
.slider-input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--primary); cursor: pointer; }
.energy-val { font-size: 0.82rem; font-weight: 600; color: var(--primary); font-family: var(--mono); min-width: 18px; }

/* Review */
.review-body { }
.review-section { margin-bottom: 16px; }
.review-section h3 { font-size: 0.88rem; font-weight: 600; margin-bottom: 6px; }
.review-textarea { min-height: 80px; resize: vertical; line-height: 1.7; }

/* Goals */
.goals-list { margin-bottom: 6px; }
.goal-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 0.82rem; }
.goal-item .goal-name { flex: 1; }
.goal-item input[type="range"] { width: 80px; }
.goal-item .goal-pct { font-family: var(--mono); font-size: 0.78rem; color: var(--primary); min-width: 30px; }
.goal-item .remove-goal { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.7rem; }
.goal-item .remove-goal:hover { color: var(--danger); }

.actions-row { display: flex; gap: 10px; margin-top: 20px; }

.footer { padding: 16px 0; text-align: center; font-size: 0.72rem; color: var(--text-muted); border-top: 1px solid var(--border); margin-top: auto; }

.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
@media (max-width: 800px) { .main { grid-template-columns: 1fr; } }
