/* ═══ Morning Ritual v3 — Warm Light Theme ════════════════════════════ */
:root {
  --bg:        #f7f4ef;
  --surface:   #ffffff;
  --surface2:  #f0ece5;
  --border:    #e4dfd7;
  --border2:   #cdc8bf;
  --gold:      #a07830;
  --gold-light:#c9a84c;
  --gold-glow: rgba(160,120,48,0.08);
  --gold-bg:   #fdf8ee;
  --text:      #1c1a17;
  --muted:     #6b6560;
  --muted2:    #a09890;
  --red:       #b83232;
  --green:     #2a7a52;
  --blue:      #2055a0;
  --purple:    #6a3a90;
  --radius:    16px;
  --radius-sm: 10px;
  --font:      'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--gold); text-decoration: none; }

/* ─── Home screen (mode picker) ───────────────────────────────────────── */
.home-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: var(--bg);
}

.home-greeting {
  text-align: center;
  margin-bottom: 2.5rem;
}
.home-greeting .time-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.home-greeting h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 6px;
}
.home-greeting .sub {
  font-size: 15px;
  color: var(--muted);
}

/* Points pill on home */
.points-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-light);
  border-radius: 30px;
  padding: 6px 16px;
  margin-bottom: 2rem;
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
}

/* Mode cards grid */
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
  max-width: 520px;
}

.mode-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
}
.mode-card:hover {
  border-color: var(--gold-light);
  background: var(--gold-bg);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(160,120,48,0.1);
  text-decoration: none;
}
.mode-card.done {
  border-color: var(--green);
  background: rgba(42,122,82,0.04);
}
.mode-card.done::after {
  content: '✓';
  position: absolute;
  top: 10px; right: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  background: rgba(42,122,82,0.1);
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  line-height: 22px;
  text-align: center;
}
.mode-icon { font-size: 32px; margin-bottom: 10px; display: block; }
.mode-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.mode-desc  { font-size: 12px; color: var(--muted); line-height: 1.4; }
.mode-pts   { font-size: 11px; font-weight: 700; color: var(--gold); margin-top: 8px; }

/* ─── Mode page layout ────────────────────────────────────────────────── */
.mode-wrap {
  min-height: 100vh;
  background: var(--bg);
  padding: 0;
}

.mode-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.mode-topbar .back-btn {
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
  text-decoration: none;
  line-height: 1;
  padding: 4px;
}
.mode-topbar .back-btn:hover { color: var(--text); }
.mode-topbar .mode-topbar-title { font-size: 16px; font-weight: 700; color: var(--text); }
.mode-topbar .mode-topbar-pts { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--gold); background: var(--gold-bg); border: 1px solid var(--gold-light); padding: 4px 10px; border-radius: 20px; }

.mode-body { padding: 1.5rem; max-width: 680px; margin: 0 auto; }

/* ─── Cards ───────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card-gold { border-color: var(--gold-light); background: var(--gold-bg); }
.card-title { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.75rem; }

/* ─── Ritual card ─────────────────────────────────────────────────────── */
.ritual-hero {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.ritual-icon { font-size: 52px; margin-bottom: 12px; display: block; }
.ritual-title { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.ritual-desc { font-size: 15px; color: var(--muted); line-height: 1.6; max-width: 400px; margin: 0 auto 1.5rem; }
.ritual-done-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(42,122,82,0.1); border: 1px solid var(--green);
  color: var(--green); border-radius: 30px; padding: 8px 20px;
  font-size: 14px; font-weight: 700;
}

/* ─── To-do ───────────────────────────────────────────────────────────── */
.todo-add-row {
  display: flex; gap: 8px; margin-bottom: 1rem;
}
.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: all 0.15s;
}
.todo-item:hover { border-color: var(--border2); }
.todo-item.done { opacity: 0.55; }
.todo-item.done .todo-label { text-decoration: line-through; color: var(--muted); }
.todo-check {
  width: 22px; height: 22px;
  border: 2px solid var(--border2);
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  transition: all 0.15s;
  background: var(--surface);
}
.todo-item.done .todo-check { background: var(--green); border-color: var(--green); color: #fff; }
.todo-label { font-size: 14px; flex: 1; color: var(--text); }
.todo-priority { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
.priority-high   { background: rgba(184,50,50,0.1); color: var(--red); }
.priority-medium { background: rgba(160,120,48,0.1); color: var(--gold); }
.priority-low    { background: rgba(42,122,82,0.1); color: var(--green); }
.todo-del { background: none; border: none; color: var(--muted2); cursor: pointer; font-size: 16px; padding: 0 4px; line-height: 1; }
.todo-del:hover { color: var(--red); }

/* ─── Journal / guided prompts ────────────────────────────────────────── */
.prompt-card {
  background: var(--gold-bg);
  border: 1px solid var(--gold-light);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 15px;
  font-style: italic;
  color: var(--text);
  line-height: 1.6;
}

.delulu-practice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 1.5rem;
}
.delulu-practice-card {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.delulu-practice-card:hover, .delulu-practice-card.selected {
  border-color: var(--gold-light);
  background: var(--gold-bg);
}
.delulu-num { font-size: 10px; color: var(--gold); font-weight: 700; margin-bottom: 4px; }
.delulu-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }

/* ─── Manifest board ──────────────────────────────────────────────────── */
.manifest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 12px; }
.manifest-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; position: relative; overflow: hidden;
}
.manifest-card::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; }
.status-manifesting::after { background: var(--gold-light); }
.status-loading::after     { background: var(--blue); }
.status-arrived::after     { background: var(--green); }
.manifest-cat { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted2); margin-bottom: 6px; }
.manifest-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; line-height: 1.3; }
.manifest-detail { font-size: 13px; color: var(--muted); line-height: 1.5; }
.manifest-status { margin-top: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.status-manifesting .manifest-status { color: var(--gold); }
.status-loading .manifest-status     { color: var(--blue); }
.status-arrived .manifest-status     { color: var(--green); }

/* ─── Entry list ──────────────────────────────────────────────────────── */
.entry-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem 1.25rem; margin-bottom: 10px;
}
.entry-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.entry-type {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 20px;
}
.type-gratitude     { background: rgba(42,122,82,0.1);  color: var(--green); }
.type-journal       { background: rgba(32,85,160,0.1);  color: var(--blue); }
.type-delulu        { background: rgba(160,120,48,0.1); color: var(--gold); }
.type-future_memory { background: rgba(106,58,144,0.1); color: var(--purple); }
.type-letter        { background: rgba(32,85,160,0.1);  color: var(--blue); }
.entry-date { font-size: 12px; color: var(--muted); margin-left: auto; }
.entry-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.entry-body { font-size: 14px; color: var(--muted); line-height: 1.6; white-space: pre-wrap; }
.entry-pts { font-size: 11px; font-weight: 700; color: var(--gold); background: var(--gold-bg); padding: 2px 7px; border-radius: 10px; }

/* ─── Forms ───────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px;
  font-family: var(--font); color: var(--text); transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--gold-light); background: var(--surface);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.form-textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; font-family: var(--font);
  cursor: pointer; border: 1.5px solid transparent; transition: all 0.15s;
  text-decoration: none;
}
.btn-primary { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-primary:hover { background: #7a5a22; border-color: #7a5a22; color: #fff; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border2); }
.btn-ghost:hover { color: var(--text); border-color: var(--border2); background: var(--surface2); text-decoration: none; }
.btn-success { background: var(--green); color: #fff; border-color: var(--green); }
.btn-success:hover { background: #1e5e3e; color: #fff; text-decoration: none; }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: rgba(184,50,50,0.08); text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ─── Mood ────────────────────────────────────────────────────────────── */
.mood-row { display: flex; gap: 8px; margin-top: 6px; }
.mood-pill { flex: 1; padding: 10px; text-align: center; border-radius: var(--radius-sm); border: 1.5px solid var(--border2); cursor: pointer; font-size: 20px; background: var(--surface2); transition: all 0.15s; }
.mood-pill:hover, .mood-pill.selected { border-color: var(--gold-light); background: var(--gold-bg); }

/* ─── Alert ───────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 1rem; border: 1px solid; }
.alert-success { background: rgba(42,122,82,0.08); border-color: var(--green); color: var(--green); }
.alert-error   { background: rgba(184,50,50,0.08); border-color: var(--red);   color: var(--red); }

/* ─── Modal ───────────────────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 999; align-items: center; justify-content: center; padding: 1rem; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-shadow: 0 12px 40px rgba(0,0,0,0.12); }
.modal-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 1.25rem; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 1.25rem; }

/* ─── Admin layout ────────────────────────────────────────────────────── */
.admin-wrap { min-height: 100vh; display: flex; }
.admin-sidebar {
  width: 220px; background: var(--surface); border-right: 1px solid var(--border);
  position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
}
.admin-logo { padding: 1.25rem; border-bottom: 1px solid var(--border); }
.admin-logo-text { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.admin-nav { flex: 1; padding: 0.5rem 0; }
.admin-nav-label { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted2); padding: 0.75rem 1rem 0.3rem; }
.admin-nav-item { display: flex; align-items: center; gap: 8px; padding: 0.55rem 1rem; font-size: 13px; color: var(--muted); cursor: pointer; text-decoration: none; transition: all 0.12s; border-left: 2px solid transparent; }
.admin-nav-item:hover { color: var(--text); background: var(--surface2); text-decoration: none; }
.admin-nav-item.active { color: var(--gold); border-left-color: var(--gold); background: var(--gold-glow); }
.admin-content { margin-left: 220px; padding: 2rem; flex: 1; max-width: 900px; }
.admin-footer { padding: 1rem; border-top: 1px solid var(--border); font-size: 12px; }

/* ─── Page header ─────────────────────────────────────────────────────── */
.page-header { margin-bottom: 1.75rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.page-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.page-title { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.2; }
.page-sub { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* ─── Table ───────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface2); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface2); }
.badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 20px; }
.badge-admin  { background: rgba(160,120,48,0.12); color: var(--gold); }
.badge-user   { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.badge-active { background: rgba(42,122,82,0.1); color: var(--green); }

/* ─── Login ───────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-box { width: 100%; max-width: 380px; padding: 2.5rem 2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 24px rgba(0,0,0,0.06); }
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo-icon { font-size: 40px; display: block; margin-bottom: 10px; }
.login-logo-text { font-size: 16px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.login-logo-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ─── Celebration modal ───────────────────────────────────────────────── */
.celebration-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.celebration-box { background: var(--surface); border: 1px solid var(--gold-light); border-radius: 20px; padding: 2.5rem 2rem; max-width: 400px; width: 100%; text-align: center; position: relative; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }

/* ─── Toast ───────────────────────────────────────────────────────────── */
#toast { position: fixed; bottom: 24px; right: 24px; background: var(--text); color: var(--surface); padding: 10px 18px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; opacity: 0; transform: translateY(8px); transition: all 0.25s; z-index: 9999; pointer-events: none; }
#toast.show { opacity: 1; transform: translateY(0); }

/* ─── Stats ───────────────────────────────────────────────────────────── */
.stats-strip { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 1.5rem; }
.stat-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; text-align: center; }
.stat-num { font-size: 26px; font-weight: 700; color: var(--gold); line-height: 1; }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.07em; }

/* ─── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .mode-grid { grid-template-columns: 1fr; max-width: 340px; }
  .delulu-practice-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .admin-sidebar { display: none; }
  .admin-content { margin-left: 0; padding: 1rem; }
  .manifest-grid { grid-template-columns: 1fr; }
}
