/* ═══════════════════════════════════
   Goals — Quarterly Goals Dashboard
   Matches NeuroStack design language
   ═══════════════════════════════════ */

.goals-layout {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 32px;
}

/* ── Page header ────────────────────────────────────────────── */
.goals-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.goals-page-title {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--slate);
  margin-bottom: 4px;
}

.goals-page-subtitle {
  font-size: 14px;
  color: var(--slate-muted);
  font-weight: 500;
}

/* ── Sunday check-in banner ─────────────────────────────────── */
.sunday-banner {
  background: linear-gradient(135deg, var(--teal-light) 0%, #e0f5ef 100%);
  border: 1px solid var(--teal);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.sunday-banner-icon { font-size: 28px; flex-shrink: 0; }

.sunday-banner-text h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 4px;
}

.sunday-banner-text p {
  font-size: 14px;
  color: var(--slate-muted);
}

.sunday-banner-action {
  margin-left: auto;
  background: var(--teal);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.sunday-banner-action:hover { opacity: 0.88; }

/* ── Goals grid ─────────────────────────────────────────────── */
.goals-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

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

.goals-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

/* ── Goal card ───────────────────────────────────────────────── */
.goal-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.goal-card:hover {
  box-shadow: 0 4px 20px rgba(0,168,150,0.08);
  border-color: var(--teal);
}

.goal-card.shelved { opacity: 0.55; }
.goal-card.done { border-left: 4px solid var(--teal); }

.goal-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.goal-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--slate);
  text-decoration: none;
  line-height: 1.3;
}

.goal-card-title:hover { color: var(--teal); }

.goal-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.goal-quarter-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--teal-light);
  color: var(--teal);
  padding: 3px 10px;
  border-radius: 999px;
}

.goal-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: capitalize;
}

.goal-status-badge.not_started { background: #f1f5f9; color: #64748b; }
.goal-status-badge.in_progress { background: #fef3c7; color: #92400e; }
.goal-status-badge.done        { background: #dcfce7; color: #166534; }
.goal-status-badge.shelved     { background: #f1f5f9; color: #94a3b8; }

.goal-card-why {
  font-size: 14px;
  color: var(--slate-muted);
  margin-bottom: 16px;
  line-height: 1.5;
  font-style: italic;
}

/* ── Progress bar ────────────────────────────────────────────── */
.goal-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.goal-progress-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.goal-progress-bar-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.goal-progress-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--teal);
  min-width: 36px;
  text-align: right;
}

.goal-progress-label {
  font-size: 12px;
  color: var(--slate-muted);
  min-width: 110px;
}

.goal-days-remaining {
  font-size: 12px;
  color: var(--slate-muted);
}

/* ── Goal card actions ───────────────────────────────────────── */
.goal-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-shelve {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 14px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: color 0.15s, border-color 0.15s;
}
.btn-shelve:hover { color: var(--slate); border-color: var(--slate-muted); }

.btn-status-update {
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-light);
  border: none;
  border-radius: var(--radius);
  padding: 6px 14px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: opacity 0.15s;
}
.btn-status-update:hover { opacity: 0.8; }

.btn-view-goal {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 14px;
  transition: border-color 0.15s;
}
.btn-view-goal:hover { border-color: var(--teal); color: var(--teal); }

/* ── Add goal form ───────────────────────────────────────────── */
.add-goal-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-top: 8px;
}

.add-goal-panel h2 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--slate);
  margin-bottom: 4px;
}

.add-goal-panel .form-hint {
  font-size: 13px;
  color: var(--slate-muted);
  margin-bottom: 24px;
}

.goal-form { display: flex; flex-direction: column; gap: 20px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
}

.form-group .field-why-hint {
  font-size: 12px;
  color: var(--slate-muted);
  font-weight: 400;
  font-style: italic;
}

.form-group input,
.form-group textarea,
.form-group select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--slate);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--teal);
}

.form-group textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 4px;
}

.btn-primary {
  background: var(--teal);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.88; }

.btn-cancel {
  background: none;
  border: 1px solid var(--border);
  color: var(--slate-muted);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
}
.btn-cancel:hover { color: var(--slate); }

/* ── Empty state ────────────────────────────────────────────── */
.goals-empty {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.goals-empty-icon { font-size: 40px; margin-bottom: 12px; }
.goals-empty h3 { font-size: 18px; font-weight: 700; color: var(--slate); margin-bottom: 8px; }
.goals-empty p { font-size: 14px; color: var(--slate-muted); max-width: 360px; margin: 0 auto 24px; }

/* ── Goal detail page ────────────────────────────────────────── */
.goal-detail-header {
  margin-bottom: 32px;
}

.goal-back-link {
  font-size: 13px;
  color: var(--teal);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
}
.goal-back-link:hover { opacity: 0.8; }

.goal-detail-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--slate);
  margin-bottom: 8px;
  line-height: 1.2;
}

.goal-detail-why {
  font-size: 15px;
  color: var(--slate-muted);
  font-style: italic;
  margin-bottom: 16px;
  line-height: 1.6;
  max-width: 620px;
}

.goal-detail-metric {
  font-size: 14px;
  color: var(--slate);
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 24px;
  border-left: 3px solid var(--teal);
}

.goal-detail-metric strong { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--slate-muted); margin-bottom: 4px; }

.goal-detail-meta { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }

.goal-detail-sections { display: flex; flex-direction: column; gap: 32px; }

.goal-section-block {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.goal-section-block h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 16px;
}

/* ── Linked tasks in detail ─────────────────────────────────── */
.linked-task-list { display: flex; flex-direction: column; gap: 8px; }

.linked-task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--slate);
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--bg);
}

.linked-task-item.done { color: var(--slate-muted); text-decoration: line-through; }
.linked-task-done-icon { color: var(--teal); font-size: 13px; }
.linked-task-date { font-size: 12px; color: var(--slate-muted); margin-left: auto; }

/* ── Check-in log ─────────────────────────────────────────────── */
.checkin-log { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }

.checkin-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.checkin-week { font-size: 12px; font-weight: 700; color: var(--teal); margin-bottom: 8px; }
.checkin-field { font-size: 13px; color: var(--slate-muted); line-height: 1.5; }
.checkin-field strong { color: var(--slate); font-weight: 600; }

/* ── Check-in form ─────────────────────────────────────────────── */
.checkin-form { display: flex; flex-direction: column; gap: 16px; }

.checkin-form textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--slate);
  background: var(--bg);
  outline: none;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.15s;
  width: 100%;
}
.checkin-form textarea:focus { border-color: var(--teal); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .goals-layout { padding: 24px 16px; }
  .goals-page-header { flex-direction: column; }
  .goal-card-top { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
  .sunday-banner { flex-direction: column; }
  .sunday-banner-action { width: 100%; text-align: center; }
}

@media (max-width: 480px) {
  .goals-layout { padding: 16px 12px; }
  .goals-page-title { font-size: 26px; }
  .goal-card { padding: 18px 16px; }
  .goal-card-title { font-size: 16px; }
  .goal-detail-title { font-size: 24px; }
  .goal-progress-label { display: none; }
  .goal-card-actions { flex-direction: column; align-items: stretch; }
  .btn-view-goal, .btn-status-update, .btn-shelve { text-align: center; }
}

@media (max-width: 320px) {
  .goals-page-title { font-size: 22px; }
  .add-goal-panel { padding: 20px 16px; }
}
