/* ═══════════════════════════════════
   ADHD Life OS Planner Styles
   Matches NeuroStack design language
   ═══════════════════════════════════ */

.planner-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  align-items: start;
}

/* ── Planner Main ─────────────────────────────────────────── */
.planner-main { display: flex; flex-direction: column; gap: 32px; }

.planner-header { display: flex; flex-direction: column; gap: 20px; }

.planner-date-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.planner-date-label {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--slate);
  margin-bottom: 4px;
}

.planner-full-date {
  font-size: 14px;
  color: var(--slate-muted);
  font-weight: 500;
}

/* ── Energy ─────────────────────────────────────────────── */
.energy-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

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

.energy-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--slate-muted);
}

.energy-value {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--teal);
  font-weight: 400;
}

.energy-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.energy-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.15s;
}
.energy-btn:hover { border-color: var(--teal); background: var(--teal-light); }
.energy-btn.active { border-color: var(--teal); background: var(--teal-light); }
.energy-btn.active .energy-icon { filter: none; }

.energy-icon { font-size: 20px; filter: grayscale(0.4); }
.energy-btn.active .energy-icon { filter: none; }
.energy-level-num { font-size: 11px; color: var(--slate-muted); font-weight: 600; }

.energy-note-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--bg);
  color: var(--slate);
  transition: border-color 0.2s;
}
.energy-note-input:focus {
  outline: none;
  border-color: var(--teal);
}

/* ── Tasks ─────────────────────────────────────────────── */
.tasks-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

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

.section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--slate-muted);
}

.task-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-light);
  padding: 2px 10px;
  border-radius: 20px;
}

.add-task-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.task-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--bg);
  color: var(--slate);
  transition: border-color 0.2s;
}
.task-input:focus { outline: none; border-color: var(--teal); }

.priority-toggle { display: flex; align-items: center; cursor: pointer; }
.priority-toggle input { display: none; }
.priority-badge {
  font-size: 16px;
  color: var(--border);
  transition: color 0.2s;
}
.priority-toggle input:checked + .priority-badge { color: #F59E0B; }

.btn-add-task {
  padding: 10px 16px;
  background: var(--teal);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-add-task:hover { background: #008f7f; }

.task-list { display: flex; flex-direction: column; gap: 2px; }

.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.task-item:hover { background: var(--bg); }
.task-item.done { opacity: 0.5; }

.task-check {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  color: white;
  flex-shrink: 0;
  transition: all 0.15s;
}
.task-check.checked { background: var(--teal); border-color: var(--teal); }

.task-content {
  flex: 1;
  font-size: 14px;
  color: var(--slate);
}
.task-content.done-text { text-decoration: line-through; color: var(--slate-muted); }

.task-priority-badge { color: #F59E0B; font-size: 13px; }

/* Goal tag on task rows */
.task-goal-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-light);
  padding: 2px 8px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
}

/* Goal selector in add-task form */
.task-goal-select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--slate-muted);
  background: var(--bg);
  outline: none;
  cursor: pointer;
  max-width: 140px;
}
.task-goal-select:focus { border-color: var(--teal); }

.task-delete {
  background: none;
  border: none;
  color: var(--border);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s;
  display: none;
}
.task-item:hover .task-delete { display: block; }
.task-delete:hover { color: #E55353; }

/* ── Reflection ─────────────────────────────────────────── */
.reflection-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reflection-input {
  width: 100%;
  min-height: 80px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--bg);
  color: var(--slate);
  resize: vertical;
  transition: border-color 0.2s;
}
.reflection-input:focus { outline: none; border-color: var(--teal); }

/* ── Sidebar ─────────────────────────────────────────────── */
.planner-sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 80px; }

.sidebar-block {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--slate);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--teal); color: var(--teal); }

/* ── Habits ─────────────────────────────────────────────── */
.btn-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: white;
  color: var(--teal);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.btn-icon:hover { background: var(--teal); color: white; border-color: var(--teal); }

.add-habit-form { margin-bottom: 12px; }
.habit-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--bg);
  color: var(--slate);
  margin-bottom: 8px;
}
.habit-input:focus { outline: none; border-color: var(--teal); }
.habit-form-actions { display: flex; gap: 8px; }

.btn-primary-sm {
  padding: 6px 14px;
  background: var(--teal);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary-sm {
  padding: 6px 14px;
  background: white;
  color: var(--slate-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
}

.habit-list { display: flex; flex-direction: column; gap: 8px; }

.habit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.habit-item:hover { background: var(--bg); }

.habit-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--teal);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.habit-checkmark.checked { color: var(--teal); }

.habit-info { flex: 1; }
.habit-name-text { font-size: 13px; font-weight: 600; color: var(--slate); display: block; }
.habit-streak { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.streak-flame { font-size: 12px; }
.streak-count { font-size: 11px; color: var(--slate-muted); }

.habit-progress-bar {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.habit-progress-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 99px;
  transition: width 0.3s;
}

.habit-delete {
  background: none;
  border: none;
  color: var(--border);
  font-size: 14px;
  cursor: pointer;
  display: none;
}
.habit-item:hover .habit-delete { display: block; }
.habit-delete:hover { color: #E55353; }

.habit-empty p { font-size: 13px; color: var(--slate-muted); }

/* ── Inbox ─────────────────────────────────────────────── */
.inbox-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--teal);
  color: white;
  padding: 2px 8px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.inbox-form { display: flex; gap: 8px; margin-bottom: 12px; }
.inbox-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13px;
  background: var(--bg);
  color: var(--slate);
}
.inbox-input:focus { outline: none; border-color: var(--teal); }

.btn-inbox {
  padding: 8px 14px;
  background: var(--slate);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-inbox:hover { background: var(--slate-mid); }

.inbox-list { display: flex; flex-direction: column; gap: 6px; }

.inbox-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--slate);
}
.inbox-item.processed { opacity: 0.4; }
.inbox-item.processed .inbox-content { text-decoration: line-through; }
.inbox-content { flex: 1; line-height: 1.5; }

.inbox-actions { display: flex; gap: 4px; flex-shrink: 0; }
.inbox-actions button {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--slate-muted);
  cursor: pointer;
  padding: 0 2px;
  transition: color 0.2s;
}
.inbox-actions button:hover { color: var(--teal); }

.inbox-empty p { font-size: 13px; color: var(--slate-muted); }

/* ── Empty States ──────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--slate-muted);
}
.empty-icon { font-size: 32px; display: block; margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ── Planner CTA Banner ──────────────────────────────────── */
.planner-cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 860px;
  margin: 0 auto 32px;
  padding: 16px 24px;
  background: var(--teal-light);
  border: 1px solid rgba(0,168,150,0.25);
  border-radius: var(--radius-lg);
  font-size: 14px;
  color: var(--slate);
}
.planner-cta-banner span { font-weight: 500; color: var(--slate); }
.cta-banner-btn {
  display: inline-block;
  background: var(--teal);
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 8px;
  transition: background 0.2s;
}
.cta-banner-btn:hover { background: #008f7d; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .planner-layout {
    grid-template-columns: 1fr;
    padding: 24px 20px;
  }
  .planner-sidebar { position: static; }
  .planner-cta-banner { flex-direction: column; gap: 12px; text-align: center; }
}

@media (max-width: 640px) {
  .planner-layout { padding: 16px; }
  .planner-date-label { font-size: 26px; }
  .energy-section, .tasks-section, .reflection-section { padding: 18px 16px; }
  .section-title { font-size: 12px; }
  .task-input { font-size: 14px; min-height: 44px; }
  .btn-add-task { padding: 10px 16px; min-height: 44px; font-size: 14px; }
  .planner-cta-banner { padding: 14px 16px; font-size: 13px; }
  .sidebar-block { padding: 16px 14px; }
  .habit-input { font-size: 13px; }
  .inbox-input { font-size: 13px; min-height: 44px; }
  .btn-inbox { padding: 8px 12px; font-size: 12px; }
}

@media (max-width: 480px) {
  .planner-layout { padding: 12px; }
  .planner-date-label { font-size: 22px; }
  .energy-btn { padding: 10px 6px; }
  .energy-btn .energy-icon { font-size: 18px; }
  .energy-value { font-size: 20px; }
  .task-item { padding: 8px 8px; }
  .task-check { width: 20px; height: 20px; }
  .task-content { font-size: 13px; }
  .add-task-form { flex-wrap: wrap; }
  .task-input { min-width: 100%; }
  .task-goal-select { min-width: 100%; }
  .export-actions { flex-wrap: wrap; }
}

@media (max-width: 320px) {
  .planner-date-label { font-size: 20px; }
  .energy-buttons { gap: 6px; }
  .task-goal-select { min-width: 100%; max-width: 100%; }
  .btn-add-task { width: 100%; }
}
/* ── Export Actions ─────────────────────────────────────── */
.export-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-text-link {
  background: none;
  border: none;
  color: var(--teal);
  font-size: 12px;
  font-family: var(--font-sans);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.75;
  transition: opacity 0.15s;
}
.btn-text-link:hover { opacity: 1; }
