/* ── v2 dark theme ───────────────────────────────────────────────────────────── */
/* ── RESET ───────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── VARIABLES ───────────────────────────────────────────────────────────────── */
:root {
  --sidebar-w: 240px;
  --mobile-header: 52px;

  /* Dark palette */
  --bg: #050506;
  --card: rgba(255,255,255,0.04);
  --card-border: rgba(255,255,255,0.07);
  --sidebar-bg: rgba(255,255,255,0.025);
  --sidebar-border: rgba(255,255,255,0.06);
  --input-bg: rgba(255,255,255,0.06);
  --input-border: rgba(255,255,255,0.1);
  --hover: rgba(255,255,255,0.05);
  --active: rgba(255,255,255,0.08);

  /* Text */
  --text: #fafafa;
  --text-2: #b8b6b0;
  --text-3: #76746e;

  /* Accents */
  --primary: #e07658;
  --primary-glow: rgba(224,118,88,0.25);
  --success: #6be3a4;
  --success-glow: rgba(107,227,164,0.2);
  --warning: #f2c063;
  --danger: #ff6b6b;
  --info: #7eb8f7;

  /* Misc */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(0,0,0,0.45);
  --shadow-sm: 0 4px 16px rgba(0,0,0,0.3);
}

/* ── BACKGROUND ──────────────────────────────────────────────────────────────── */
.app-body, .login-body {
  background-color: var(--bg);
  min-height: 100vh;
  color: var(--text);
}

/* Animated gradient blobs */
.app-body::before, .login-body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 800px 600px at 82% 14%, rgba(224,118,88,0.14) 0%, transparent 70%),
    radial-gradient(ellipse 600px 800px at 18% 90%, rgba(180,180,200,0.05) 0%, transparent 70%);
  filter: blur(40px);
  animation: drift-bg 36s ease-in-out infinite alternate;
}

/* Grid texture overlay */
.app-body::after, .login-body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: repeating-linear-gradient(
    0deg,
    repeating-linear-gradient(90deg, rgba(255,255,255,0.014), rgba(255,255,255,0.014) 3px, transparent 3px, transparent 6px),
    transparent 0, transparent 3px
  );
  background-size: 6px 6px;
}

@keyframes drift-bg {
  0%   { filter: blur(40px) translate(0, 0); }
  100% { filter: blur(40px) translate(8px, -8px); }
}

/* Everything above the bg layers */
.sidebar, .main, .mobile-header, .modal-backdrop, .login-card { position: relative; z-index: 1; }

/* ── LOGIN ───────────────────────────────────────────────────────────────────── */
.login-body { display: flex; align-items: center; justify-content: center; padding: 20px; }

.login-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 380px;
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}

.login-logo { text-align: center; margin-bottom: 36px; }
.login-logo .logo-icon { font-size: 44px; display: block; margin-bottom: 12px; }
.login-logo h1 {
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(180deg, #fff 0%, #c7c4bc 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-error {
  background: rgba(255,107,107,0.1);
  color: var(--danger);
  border: 1px solid rgba(255,107,107,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: .875rem;
}

/* ── LAYOUT ──────────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
  transition: transform .25s ease;
}

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 32px;
}

.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--mobile-header);
  background: rgba(5,5,6,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--sidebar-border);
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 90;
}
.mobile-header .logo-text { color: var(--text); font-weight: 700; font-size: .95rem; }
.menu-btn { color: var(--text-2); font-size: 20px; padding: 6px 8px; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 99;
}

/* ── SIDEBAR INTERNALS ───────────────────────────────────────────────────────── */
.sidebar-header {
  padding: 22px 18px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-header .logo-icon { font-size: 20px; }
.sidebar-header .logo-text {
  font-weight: 700;
  font-size: .9rem;
  background: linear-gradient(180deg, #fff 0%, #c7c4bc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav { padding: 10px 8px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: .85rem;
  font-weight: 500;
  transition: all .15s;
  margin-bottom: 1px;
}
.nav-item:hover { background: var(--hover); color: var(--text-2); }
.nav-item.active { background: var(--active); color: var(--text); }
.nav-icon { font-size: 15px; width: 18px; text-align: center; }

.sidebar-section-title {
  padding: 14px 18px 5px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--text-3);
  text-transform: uppercase;
}

.sidebar-folders { padding: 2px 8px 8px; flex: 1; }
.sidebar-folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: .825rem;
  transition: all .15s;
  cursor: pointer;
  margin-bottom: 1px;
}
.sidebar-folder-item:hover { background: var(--hover); color: var(--text-2); }
.sidebar-folder-item.active { background: var(--active); color: var(--text); }
.folder-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.sidebar-footer {
  padding: 8px;
  border-top: 1px solid var(--sidebar-border);
}
.logout-link { color: var(--text-3) !important; }
.logout-link:hover { color: var(--danger) !important; background: rgba(255,107,107,0.08) !important; }

/* ── SECTION TITLE (shared) ──────────────────────────────────────────────────── */
.section-title {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.section-title::before { content: ''; width: 16px; height: 1px; background: var(--text-3); opacity: .5; flex-shrink: 0; }
.section-title::after  { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255,255,255,0.07), transparent); }
.section-title .section-action { -webkit-text-fill-color: initial; text-transform: none; letter-spacing: 0; font-size: .75rem; margin-left: auto; }

/* ── PAGE HEADER ─────────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.025em;
  background: linear-gradient(180deg, #fff 0%, #c7c4bc 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── CARDS ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(24px) saturate(1.2);
  box-shadow: var(--shadow);
}
.card-sm { padding: 14px 16px; }

/* ── FORMS ───────────────────────────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 7px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 13px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.field textarea { resize: vertical; min-height: 100px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: rgba(255,255,255,0.25); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field select option { background: #1a1a1e; color: var(--text); }

/* ── BUTTONS ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-weight: 600;
  transition: all .15s;
  letter-spacing: .01em;
}
.btn-primary {
  background: rgba(224,118,88,0.15);
  color: var(--primary);
  border: 1px solid rgba(224,118,88,0.25);
}
.btn-primary:hover { background: rgba(224,118,88,0.25); }
.btn-success {
  background: rgba(107,227,164,0.12);
  color: var(--success);
  border: 1px solid rgba(107,227,164,0.2);
}
.btn-danger {
  background: rgba(255,107,107,0.1);
  color: var(--danger);
  border: 1px solid rgba(255,107,107,0.2);
}
.btn-danger:hover { background: rgba(255,107,107,0.2); }
.btn-ghost {
  background: var(--input-bg);
  color: var(--text-2);
  border: 1px solid var(--input-border);
}
.btn-ghost:hover { background: var(--hover); color: var(--text); }
.btn-sm { padding: 5px 11px; font-size: .75rem; }
.btn-full { width: 100%; justify-content: center; padding: 11px; font-size: .9rem; }
.btn-icon { padding: 6px; border-radius: 8px; color: var(--text-3); }
.btn-icon:hover { background: var(--hover); color: var(--text-2); }

/* ── HOME ────────────────────────────────────────────────────────────────────── */
.home-greeting { margin-bottom: 28px; }
.home-greeting h2 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -.03em;
  background: linear-gradient(180deg, #fff 0%, #c7c4bc 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.home-greeting p { color: var(--text-3); margin-top: 4px; font-size: .85rem; font-family: ui-monospace, monospace; }

/* Goal ticker */
.goal-ticker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0.42) 0%, rgba(0,0,0,0.28) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  margin-bottom: 6px;
  position: relative;
  overflow: hidden;
}
.goal-ticker::after {
  content: '';
  position: absolute;
  top: 0; left: -40%;
  width: 30%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  animation: ticker-sweep 8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ticker-sweep { 0% { left: -40%; } 50% { left: 50%; } 100% { left: 110%; } }

.goal-ticker-led { display: flex; align-items: center; justify-content: center; width: 16px; flex-shrink: 0; }
.goal-ticker-led-dot {
  width: 7px; height: 7px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(107,227,164,0.7);
  animation: pulse-led 1.6s ease-in-out infinite;
}
@keyframes pulse-led {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.85); }
}
.goal-ticker-label {
  font-family: ui-monospace, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .18em;
  color: var(--text-3);
  text-transform: uppercase;
  flex-shrink: 0;
}
.goal-ticker-text {
  flex: 1;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.goal-ticker-meta {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text-2);
  padding: 2px 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 99px;
  flex-shrink: 0;
  text-transform: uppercase;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-icon { font-size: 20px; }
.stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff 0%, #c7c4bc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}
.stat-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-3);
  font-family: ui-monospace, monospace;
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.chart-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(24px);
}
.chart-card h3 {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart-card h3::before { content: ''; width: 14px; height: 1px; background: var(--text-3); opacity: .5; }
.chart-wrap { position: relative; height: 180px; }

/* Folders grid */
.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.folder-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(24px);
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  border-top: 2px solid;
}
.folder-card:hover { background: var(--hover); transform: translateY(-2px); }
.folder-card-icon { font-size: 28px; margin-bottom: 8px; }
.folder-card-name { font-weight: 600; color: var(--text); font-size: .85rem; }
.folder-card-count { font-size: .7rem; color: var(--text-3); margin-top: 3px; font-family: ui-monospace, monospace; }
.add-folder-card {
  background: transparent;
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 110px;
}
.add-folder-card:hover { border-color: var(--primary); background: rgba(224,118,88,0.05); }
.add-folder-card span { color: var(--text-3); font-size: .8rem; }

/* ── NOTES ───────────────────────────────────────────────────────────────────── */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.note-card {
  border-radius: var(--radius);
  padding: 16px;
  min-height: 130px;
  position: relative;
  transition: transform .2s;
  border-left: 3px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow-sm);
}
.note-card:hover { transform: translateY(-2px); }
.note-card-title { font-weight: 700; font-size: .9rem; margin-bottom: 8px; }
.note-card-content { font-size: .8rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 110px; overflow: hidden; opacity: .85; }
.note-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.note-card-date { font-size: .7rem; opacity: .6; font-family: ui-monospace, monospace; }
.note-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.note-card:hover .note-actions { opacity: 1; }
.note-pin { font-size: 12px; opacity: .3; cursor: pointer; }
.note-pin.pinned { opacity: 1; }

.color-picker { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.color-dot { width: 22px; height: 22px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: border-color .15s; }
.color-dot.selected, .color-dot:hover { border-color: rgba(255,255,255,0.6); }

/* ── TODOS ───────────────────────────────────────────────────────────────────── */
.todo-progress { margin-bottom: 18px; }
.progress-bar-wrap { background: rgba(255,255,255,0.08); border-radius: 99px; height: 6px; overflow: hidden; margin-top: 8px; }
.progress-bar-fill { height: 100%; background: var(--success); border-radius: 99px; transition: width .4s ease; box-shadow: 0 0 10px rgba(107,227,164,0.4); }
.progress-label { font-size: .75rem; color: var(--text-3); font-family: ui-monospace, monospace; }

.todo-input-row { display: flex; gap: 10px; margin-bottom: 18px; align-items: flex-end; }
.todo-input-row input { flex: 1; }

.todo-list { display: flex; flex-direction: column; gap: 3px; }
.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(24px);
  transition: opacity .2s;
}
.todo-item.done { opacity: .45; }
.todo-checkbox {
  width: 18px; height: 18px;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 5px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  font-size: 11px;
}
.todo-checkbox.checked { background: var(--success); border-color: var(--success); color: #050506; box-shadow: 0 0 8px var(--success-glow); }
.todo-title { flex: 1; font-size: .875rem; color: var(--text); }
.todo-item.done .todo-title { text-decoration: line-through; }
.todo-due { font-size: .7rem; color: var(--text-3); font-family: ui-monospace, monospace; }
.todo-delete { opacity: 0; transition: opacity .15s; color: var(--text-3) !important; }
.todo-item:hover .todo-delete { opacity: 1; }

/* ── JOURNAL ─────────────────────────────────────────────────────────────────── */
.journal-list { display: flex; flex-direction: column; gap: 8px; }
.journal-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(24px);
  cursor: pointer;
  transition: background .15s;
}
.journal-item:hover { background: var(--hover); }
.journal-mood { font-size: 20px; flex-shrink: 0; }
.journal-info { flex: 1; }
.journal-title { font-weight: 600; color: var(--text); font-size: .875rem; }
.journal-date { font-size: .7rem; color: var(--text-3); margin-top: 2px; font-family: ui-monospace, monospace; }

.journal-editor { display: flex; flex-direction: column; gap: 14px; }
.journal-editor textarea {
  min-height: 280px;
  font-size: .9rem;
  line-height: 1.7;
  padding: 14px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  resize: vertical;
  outline: none;
  color: var(--text);
}
.journal-editor textarea:focus { border-color: rgba(255,255,255,0.2); }
.journal-editor textarea::placeholder { color: var(--text-3); }

.mood-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.mood-btn {
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--input-border);
  font-size: .78rem;
  cursor: pointer;
  transition: all .15s;
  background: var(--input-bg);
  color: var(--text-2);
}
.mood-btn.active { border-color: rgba(224,118,88,0.4); background: rgba(224,118,88,0.1); color: var(--primary); }

/* ── QUESTIONNAIRES ──────────────────────────────────────────────────────────── */
.quiz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.quiz-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(24px);
  cursor: pointer;
  transition: background .15s;
  border-left: 3px solid var(--primary);
}
.quiz-card:hover { background: var(--hover); }
.quiz-card-title { font-weight: 700; font-size: .95rem; color: var(--text); }
.quiz-card-desc { font-size: .8rem; color: var(--text-3); margin-top: 6px; }
.quiz-card-meta { display: flex; gap: 12px; margin-top: 10px; font-size: .7rem; color: var(--text-3); font-family: ui-monospace, monospace; }
.quiz-card-actions { display: flex; gap: 8px; margin-top: 14px; }

.question-builder { display: flex; flex-direction: column; gap: 10px; }
.question-item {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.question-row { display: flex; gap: 8px; align-items: flex-start; }
.question-row input { flex: 1; }
.question-type-select { width: 130px; flex-shrink: 0; }
.add-question-btn {
  padding: 10px;
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  color: var(--text-3);
  font-size: .8rem;
  transition: all .15s;
}
.add-question-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(224,118,88,0.05); }

.quiz-response-form { display: flex; flex-direction: column; gap: 16px; }
.response-question label { font-weight: 600; color: var(--text); margin-bottom: 8px; display: block; font-size: .875rem; }
.rating-group { display: flex; gap: 8px; }
.rating-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--input-border);
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  transition: all .15s;
  background: var(--input-bg);
  color: var(--text-2);
}
.rating-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 0 12px var(--primary-glow); }

/* ── SCREEN TIME ─────────────────────────────────────────────────────────────── */
.screentime-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }
.screentime-apps { display: flex; flex-direction: column; gap: 8px; }
.app-input-row { display: flex; gap: 8px; align-items: center; }
.app-input-row input { flex: 1; }
.app-input-row .minutes-input { width: 85px; }

/* ── MODAL ───────────────────────────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: rgba(20,20,22,0.95);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(40px);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 0;
}
.modal-header h3 { font-size: 1rem; font-weight: 700; color: var(--text); }
.modal-close { color: var(--text-3); font-size: 16px; padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: var(--hover); color: var(--text); }
.modal-body { padding: 18px 22px 22px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* ── BADGES ──────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  letter-spacing: .04em;
}
.badge-primary { background: rgba(224,118,88,0.12); color: var(--primary); }
.badge-success { background: rgba(107,227,164,0.12); color: var(--success); }
.badge-warning { background: rgba(242,192,99,0.12); color: var(--warning); }

/* ── FOLDER VIEW ─────────────────────────────────────────────────────────────── */
.folder-view-header { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.folder-view-icon { font-size: 36px; }
.folder-view-title {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(180deg, #fff 0%, #c7c4bc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.folder-sections { display: flex; flex-direction: column; gap: 28px; }

/* ── RESPONSES ───────────────────────────────────────────────────────────────── */
.response-card { background: var(--input-bg); border: 1px solid var(--input-border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 8px; }
.response-card-date { font-size: .7rem; color: var(--text-3); margin-bottom: 8px; font-family: ui-monospace, monospace; }
.response-answer { margin-bottom: 8px; }
.response-answer strong { font-size: .7rem; color: var(--text-3); display: block; font-family: ui-monospace, monospace; text-transform: uppercase; letter-spacing: .08em; }
.response-answer span { font-size: .875rem; color: var(--text); }

/* ── EMPTY STATE ─────────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: .5; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty-state p { font-size: .8rem; }

/* ── MISC ────────────────────────────────────────────────────────────────────── */
.loading-spinner { text-align: center; padding: 60px; color: var(--text-3); font-family: ui-monospace, monospace; font-size: .8rem; letter-spacing: .1em; }
.divider { border: none; border-top: 1px solid var(--card-border); margin: 18px 0; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mb-3 { margin-bottom: 14px; }
.text-sm { font-size: .8rem; }
.text-muted { color: var(--text-3); }
.fw-600 { font-weight: 600; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main { margin-left: 0; padding: 16px; padding-top: calc(var(--mobile-header) + 16px); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .folders-grid { grid-template-columns: repeat(2, 1fr); }
  .notes-grid { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .screentime-form { grid-template-columns: 1fr; }
  .todo-input-row { flex-direction: column; }
  .todo-input-row .btn { width: 100%; justify-content: center; }
}

