/* ══════════════════════════════════════════════════════
   GOALS PAGE UPGRADE — additive only, reuses existing tokens
   ══════════════════════════════════════════════════════ */

/* ── Header ── */
.goals-hd{background:linear-gradient(135deg,var(--bg3),var(--bg4));border:1px solid var(--border);border-radius:var(--r-lg,16px);padding:16px 18px;margin-bottom:12px}
.goals-hd-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}
.goals-hd-eyebrow{font-size:9px;font-weight:700;color:var(--blue);text-transform:uppercase;letter-spacing:.14em;margin-bottom:4px}
.goals-hd-title{font-family:var(--font-head,inherit);font-size:19px;font-weight:800;color:var(--text);letter-spacing:-0.4px}
.goals-hd-sub{font-size:12px;color:var(--text2);margin-top:4px}
.goals-hd-actions{display:flex;gap:8px;flex-wrap:wrap}
.goals-hd-ring-row{display:flex;align-items:center;gap:10px;margin-top:12px}

/* ── Overview cards ── */
.goals-overview{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px;margin-bottom:14px}
.goals-ov-card{background:var(--bg3);border:1px solid var(--border);border-radius:12px;padding:12px 13px}
.goals-ov-label{font-size:9.5px;font-weight:700;color:var(--text3);text-transform:uppercase;letter-spacing:.08em}
.goals-ov-val{font-size:20px;font-weight:800;color:var(--text);margin-top:6px;line-height:1.1}
.goals-ov-sub{font-size:11px;color:var(--text2);margin-top:4px;line-height:1.4}
.goals-ov-ring{width:46px;height:46px;flex-shrink:0}

/* ── Insights / Upcoming ── */
.goals-panel{background:var(--bg3);border:1px solid var(--border);border-radius:12px;padding:12px 14px;margin-bottom:12px}
.goals-panel-title{font-size:11px;font-weight:700;color:var(--text);text-transform:uppercase;letter-spacing:.06em;margin-bottom:8px}
.goals-insight-row{display:flex;align-items:flex-start;gap:8px;font-size:12px;color:var(--text2);padding:5px 0;line-height:1.5}
.goals-insight-row .dot{width:5px;height:5px;border-radius:50%;background:var(--purple);margin-top:6px;flex-shrink:0}
.goals-upcoming-row{display:flex;align-items:center;gap:10px;font-size:12px;color:var(--text2);padding:6px 0;border-bottom:1px solid var(--border2)}
.goals-upcoming-row:last-child{border-bottom:none}
.goals-upcoming-date{font-size:10.5px;font-weight:700;color:var(--gold);min-width:64px;font-family:var(--font-mono)}

/* ── Goal item cards (extends existing .cl-item, non-destructive) ── */
.goal-card{
  background:var(--glass-1);border:1px solid var(--border2);border-radius:10px;
  padding:9px 11px;margin-bottom:6px;
}
.goal-card-top{display:flex;align-items:center;gap:8px}
.goal-card-title{flex:1;min-width:0;font-size:12.5px;color:var(--text);font-weight:600}
.goal-card-badges{display:flex;gap:5px;flex-wrap:wrap;margin-top:4px}
.goal-badge{font-size:9px;font-weight:700;padding:2px 7px;border-radius:var(--r-full,999px);text-transform:uppercase;letter-spacing:.04em}
.goal-badge.status-ontrack{color:var(--green);background:var(--green-dim)}
.goal-badge.status-atrisk{color:var(--gold);background:var(--gold-glow)}
.goal-badge.status-behind{color:var(--red);background:var(--red-dim)}
.goal-badge.status-complete{color:var(--blue);background:var(--blue-dim)}
.goal-badge.priority-high{color:var(--red);background:var(--red-dim)}
.goal-badge.priority-medium{color:var(--gold);background:var(--gold-glow)}
.goal-badge.priority-low{color:var(--text3);background:var(--glass-1)}
.goal-badge.auto{color:var(--purple);background:rgba(167,139,250,0.12)}
.goal-badge.deadline{color:var(--text3);background:var(--glass-1)}
.goal-card-progress{margin-top:7px}
.goal-card-progress-label{display:flex;justify-content:space-between;font-size:10.5px;color:var(--text2);margin-bottom:3px;font-family:var(--font-mono)}
.goal-card-progress-bar{height:5px;border-radius:99px;background:var(--bg4);overflow:hidden}
.goal-card-progress-fill{height:100%;border-radius:99px;background:linear-gradient(90deg,var(--blue),var(--purple));transition:width .25s ease}
.goal-card-notes{font-size:11px;color:var(--text3);margin-top:6px;line-height:1.4;font-style:italic}
.goal-card-actions{display:flex;gap:4px;flex-shrink:0}

/* ── Goal multi-select ── */
.goal-select-box{
  width:15px;height:15px;flex-shrink:0;border-radius:4px;
  border:1.5px solid var(--border2);background:var(--bg4);
  display:flex;align-items:center;justify-content:center;
  font-size:10px;font-weight:800;color:#fff;cursor:pointer;
  transition:background .12s,border-color .12s;
}
.goal-select-box:hover{border-color:var(--blue)}
.goal-select-box.checked{background:var(--blue);border-color:var(--blue);box-shadow:0 0 6px var(--blue-glow,rgba(96,165,250,.4))}
/* Year/quarter/group rollup bars — softer than the bright-green default
   used elsewhere, since these summarize multiple goals rather than one. */
.acc-progress-fill.goals-tree-fill{background:linear-gradient(90deg,var(--blue),var(--purple))}

.goals-bulk-bar{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  background:var(--blue-dim,rgba(96,165,250,.1));border:1px solid var(--blue);
  border-radius:10px;padding:8px 12px;margin-bottom:10px;
  font-size:12px;font-weight:600;color:var(--text);
}

/* ── Personal Bests cards ── */
.goals-pb-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin-bottom:16px}
.goals-pb-card{background:var(--bg3);border:1px solid var(--border);border-radius:12px;padding:11px 12px}
.goals-pb-label{font-size:9.5px;font-weight:700;color:var(--text3);text-transform:uppercase;letter-spacing:.07em;display:flex;align-items:center;gap:5px}
.goals-pb-val{font-size:17px;font-weight:800;color:var(--green);margin-top:6px}
.goals-pb-meta{font-size:10.5px;color:var(--text3);margin-top:4px}
.goals-pb-empty{grid-column:1/-1;color:var(--text3);text-align:center;font-style:italic;padding:20px 0;font-size:12px}

/* ── Featured affirmation ── */
.aff-featured{
  background:linear-gradient(135deg,var(--bg3),var(--bg4));border:1px solid var(--border);border-radius:12px;
  padding:14px 16px;margin-bottom:12px;
}
.aff-featured-label{font-size:9.5px;font-weight:700;color:var(--purple);text-transform:uppercase;letter-spacing:.12em;margin-bottom:6px}
.aff-featured-text{font-size:15px;font-style:italic;color:var(--text);line-height:1.5}
.aff-featured-sub{font-size:11px;color:var(--text3);margin-top:6px}
.aff-featured-controls{display:flex;gap:6px;margin-top:10px}

/* ── New Goal modal form ── */
.gform-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:8px}
.gform-row.full{grid-template-columns:1fr}
.gform-field label{display:block;font-size:10px;color:var(--text3);margin-bottom:3px;text-transform:uppercase;letter-spacing:.05em}
.gform-field input,.gform-field select,.gform-field textarea{
  width:100%;background:var(--bg4);border:1px solid var(--border);color:var(--text);
  border-radius:8px;padding:7px 9px;font-size:12px;
}
.gform-field textarea{resize:vertical;min-height:50px}
.gform-hint{font-size:10.5px;color:var(--text3);margin-top:8px;line-height:1.4}

@media (max-width:640px){
  .goals-hd{padding:14px}
  .goals-hd-top{flex-direction:column;align-items:stretch}
  .goals-hd-actions{width:100%}
  .goals-hd-actions .wl-week-btn,
  .goals-hd-actions .wl-add-week-btn{flex:1;justify-content:center;text-align:center}
  .goals-overview{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
  .gform-row{grid-template-columns:1fr}
}

/* ── Goals tree: Year › Quarter › Month ── */
.goals-tree-head{
  display:flex;align-items:center;gap:8px;cursor:pointer;user-select:none;
  padding:8px 10px;border-radius:10px;background:var(--bg3);border:1px solid var(--border);
}
.goals-tree-head:hover{background:var(--glass-1)}
.goals-tree-chevron{
  display:inline-block;font-size:13px;color:var(--text3);
  transition:transform .15s ease;transform:rotate(0deg);flex-shrink:0;
}
.goals-tree-chevron.open{transform:rotate(90deg);color:var(--text2)}
.goals-year-head .goals-tree-label{font-size:13px;font-weight:800;color:var(--text)}
.goals-quarter-head .goals-tree-label{font-size:12px;font-weight:700;color:var(--text2);letter-spacing:.3px}
.goals-month-head{background:transparent;border:none;padding:6px 4px}
.goals-month-head .goals-tree-label{font-size:11px;font-weight:700;color:var(--text3);text-transform:uppercase;letter-spacing:.06em}
.goals-tree-meta{font-size:10.5px;color:var(--text3);font-family:var(--font-mono);margin-left:auto}
.goals-tree-actions{display:flex;gap:6px;margin-left:8px}
.goals-quarter-block{margin-bottom:12px}
.goals-month-block{margin-bottom:4px}
.goals-month-empty{font-size:11px;color:var(--text3);padding:6px 2px;font-style:italic}

