/* goals-v2 — class prefix .gv2-, distinct from legacy .goal-* in goals.css */

/* States */
.gv2-loading {
  padding: 24px;
  text-align: center;
  color: var(--t2);
  font-size: .9rem;
}

.gv2-error {
  padding: 12px 14px;
  background: rgba(248, 113, 113, .12);
  border: 1px solid rgba(248, 113, 113, .35);
  border-radius: var(--r-md);
  color: #fca5a5;
  font-size: .88rem;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin: 8px 0;
}

.gv2-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--t2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.gv2-empty-create {
  align-self: center;
}

/* Segmented control */
.gv2-segmented {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px;
  margin: 8px 0 16px;
}

.gv2-segmented-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--t2);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: calc(var(--r-md) - 4px);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.gv2-segmented-tab.active {
  background: var(--accent);
  color: #111118;
}

/* Tree / cards */
.gv2-tree {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gv2-row-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gv2-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.gv2-row:hover {
  border-color: var(--bd-bright);
}

.gv2-row:active {
  transform: scale(0.99);
}

.gv2-row-child {
  margin-left: 20px;
  background: var(--raised);
}

.gv2-row-children {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gv2-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gv2-row-chevron,
.gv2-row-chevron-spacer {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--t2);
  font-size: .9rem;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.gv2-row-chevron-spacer {
  cursor: default;
}

.gv2-row-title {
  flex: 1;
  font-size: .98rem;
  font-weight: 600;
  color: var(--t1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gv2-row-meta {
  font-size: .78rem;
  color: var(--t2);
}

/* Priority badges */
.gv2-priority-badge {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.gv2-priority-critical {
  background: rgba(248, 113, 113, .18);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, .4);
}

.gv2-priority-high {
  background: rgba(251, 146, 60, .18);
  color: var(--orange);
  border-color: rgba(251, 146, 60, .4);
}

.gv2-priority-medium {
  background: rgba(96, 165, 250, .15);
  color: var(--blue);
  border-color: rgba(96, 165, 250, .35);
}

.gv2-priority-low {
  background: var(--raised);
  color: var(--t2);
  border-color: var(--border);
}

/* Pace bar */
.gv2-pace-bar {
  height: 6px;
  background: var(--raised);
  border-radius: 3px;
  overflow: hidden;
}

.gv2-pace-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width var(--dur) var(--ease);
}

/* Status colors */
.gv2-status-on-track {
  background: var(--green) !important;
}
.gv2-status-drifting {
  background: var(--amber) !important;
}
.gv2-status-at-risk {
  background: #f87171 !important;
}
.gv2-status-done {
  background: var(--blue) !important;
}

/* Status pill (detail) */
.gv2-status-pill {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--border);
  color: var(--t2);
}

.gv2-status-pill.gv2-status-on-track { background: rgba(52, 211, 153, .15); color: var(--green); border-color: rgba(52, 211, 153, .4); }
.gv2-status-pill.gv2-status-drifting { background: rgba(251, 191, 36, .15); color: var(--amber); border-color: rgba(251, 191, 36, .4); }
.gv2-status-pill.gv2-status-at-risk  { background: rgba(248, 113, 113, .15); color: #fca5a5; border-color: rgba(248, 113, 113, .4); }
.gv2-status-pill.gv2-status-done     { background: rgba(96, 165, 250, .15); color: var(--blue); border-color: rgba(96, 165, 250, .4); }

/* Detail */
.gv2-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gv2-detail-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gv2-detail-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--t1);
}

.gv2-detail-desc {
  color: var(--t2);
  font-size: .9rem;
  line-height: 1.4;
}

.gv2-detail-pills {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.gv2-detail-dates {
  font-size: .78rem;
  color: var(--t3);
}

.gv2-detail-parent {
  font-size: .82rem;
  color: var(--accent);
  text-decoration: none;
}

.gv2-detail-parent:hover {
  text-decoration: underline;
}

.gv2-pace-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.gv2-pace-text {
  font-size: .82rem;
  color: var(--t2);
}

/* Progress form */
.gv2-progress-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

/* Recent + subgoal lists */
.gv2-recent-section,
.gv2-sub-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gv2-recent-list,
.gv2-sub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
}

.gv2-recent-row {
  display: grid;
  grid-template-columns: 90px 56px 1fr;
  gap: 10px;
  padding: 8px 10px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .82rem;
}

.gv2-recent-date { color: var(--t3); }
.gv2-recent-delta {
  color: var(--accent);
  font-weight: 700;
  text-align: right;
}
.gv2-recent-note { color: var(--t2); overflow: hidden; text-overflow: ellipsis; }

.gv2-recent-empty {
  padding: 10px 12px;
  color: var(--t3);
  font-size: .82rem;
}

.gv2-sub-row a {
  display: block;
  padding: 8px 10px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--t1);
  text-decoration: none;
  font-size: .9rem;
}

.gv2-sub-row a:hover {
  border-color: var(--bd-bright);
}

/* Action row */
.gv2-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* Modal action row */
.gv2-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

/* Toast */
.gv2-toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #111118;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--r-md);
  z-index: 300;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: gv2-toast-in 280ms var(--ease);
}

.gv2-toast-out {
  animation: gv2-toast-out 380ms var(--ease) forwards;
}

@keyframes gv2-toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes gv2-toast-out {
  from { opacity: 1; transform: translate(-50%, 0); }
  to   { opacity: 0; transform: translate(-50%, 12px); }
}

/* Top-level Goals/Experiments switch — sits above the inner status segmented */
.gv2-segmented-top {
  margin: 0 0 12px;
}

.gv2-experiments-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
