/* ═══════════════════════════════════════════════════════════════
   UNIFIED GOALS — SIMP-01
   Replaces separate Savings Goals + Sinking Funds with one
   unified "Goals" page. Supports simple goals and recurring goals.
   ═══════════════════════════════════════════════════════════════ */

/* ── Section Header ──────────────────────────────────────── */

.goals-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.goals-section-title {
    font-size: var(--text-heading);
    font-weight: var(--font-bold);
    letter-spacing: -0.02em;
}

.goals-section-subtitle {
    font-size: var(--text-caption);
    color: var(--text-secondary);
    margin-top: 2px;
}

.goals-btn-add {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: var(--text-small);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    font-family: inherit;
    min-height: var(--touch-target);
}

.goals-btn-add:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.goals-btn-add:active {
    transform: scale(0.97);
}

/* ── Summary Card ─────────────────────────────────────────── */

.goals-summary {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    text-align: center;
}

.goals-summary-amount {
    font-size: var(--text-title);
    font-weight: var(--font-bold);
    letter-spacing: -0.03em;
    color: var(--success);
}

.goals-summary-label {
    font-size: var(--text-caption);
    color: var(--text-secondary);
    margin-top: 4px;
}

.goals-summary-row {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-light);
}

.goals-summary-stat {
    text-align: center;
}

.goals-summary-stat-value {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
}

.goals-summary-stat-label {
    font-size: var(--text-micro);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

/* ── Goal Cards ───────────────────────────────────────────── */

.goal-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.goal-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.goal-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.goal-card:active {
    transform: scale(0.99);
}

.goal-top {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.goal-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    background: var(--icon-savings-bg);
    color: white;
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.3);
}

.goal-info {
    flex: 1;
    min-width: 0;
}

.goal-name {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    margin-bottom: 2px;
}

.goal-meta {
    font-size: var(--text-small);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Badges ───────────────────────────────────────────────── */

.goal-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--text-micro);
    font-weight: var(--font-semibold);
}

.goal-badge-recurring {
    background: var(--primary-light);
    color: var(--primary);
}

.goal-badge-monthly {
    background: var(--success-light);
    color: var(--success);
}

.goal-badge-urgent {
    background: var(--warning-light);
    color: var(--warning);
}

/* ── Amounts ──────────────────────────────────────────────── */

.goal-amounts {
    display: flex;
    align-items: baseline;
    gap: 6px;
    text-align: right;
}

.goal-current {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    font-variant-numeric: tabular-nums;
}

.goal-target {
    font-size: var(--text-small);
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
}

/* ── Progress Bar ─────────────────────────────────────────── */

.goal-progress {
    margin-top: var(--space-sm);
}

.goal-progress-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.goal-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--success);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.goal-progress-fill.funded {
    background: var(--success);
}

.goal-progress-fill.on-track {
    background: var(--primary);
}

.goal-progress-fill.behind {
    background: var(--warning);
}

.goal-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.goal-progress-pct {
    font-size: var(--text-micro);
    font-weight: var(--font-semibold);
    color: var(--success);
}

.goal-progress-eta {
    font-size: var(--text-micro);
    color: var(--text-muted);
}

/* ── Owner Dots ───────────────────────────────────────────── */

.goal-owner {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: var(--font-bold);
    color: white;
    flex-shrink: 0;
}

/* ── Expanded Detail View ─────────────────────────────────── */

.goal-detail {
    display: none;
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-light);
}

.goal-card.expanded .goal-detail {
    display: block;
}

.goal-detail-section-title {
    font-size: var(--text-micro);
    font-weight: var(--font-semibold);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-sm);
}

.goal-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.goal-detail-row:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}

.goal-detail-label {
    font-size: var(--text-small);
    color: var(--text-secondary);
}

.goal-detail-value {
    font-size: var(--text-small);
    font-weight: var(--font-medium);
    font-variant-numeric: tabular-nums;
}

/* ── History ──────────────────────────────────────────────── */

.goal-history-list {
    margin-top: var(--space-sm);
}

.goal-history-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 0;
    font-size: var(--text-small);
}

.goal-history-item:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}

.goal-history-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.goal-history-dot-deposit {
    background: var(--success);
}

.goal-history-dot-withdraw {
    background: var(--danger);
}

.goal-history-amount {
    margin-left: auto;
    font-weight: var(--font-medium);
    font-variant-numeric: tabular-nums;
}

.goal-history-date {
    color: var(--text-muted);
    font-size: var(--text-micro);
}

/* ── Achieved Section ─────────────────────────────────────── */

.goals-achieved-section {
    margin-top: var(--space-xl);
    opacity: 0.7;
}

.goals-achieved-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    cursor: pointer;
}

.goals-achieved-title {
    font-size: var(--text-caption);
    font-weight: var(--font-semibold);
    color: var(--text-tertiary);
}

.goals-achieved-count {
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--text-micro);
    color: var(--text-muted);
}

.goals-achieved-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.goals-achieved-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: var(--success-light);
}

.goals-achieved-name {
    font-size: var(--text-small);
    font-weight: var(--font-medium);
}

.goals-achieved-date {
    font-size: var(--text-micro);
    color: var(--text-muted);
}

.goals-achieved-check {
    margin-left: auto;
    color: var(--success);
    font-size: 1.1rem;
}

/* ── Empty State ──────────────────────────────────────────── */

.goals-empty {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
}

.goals-empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.goals-empty-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-xs);
}

.goals-empty-desc {
    font-size: var(--text-body);
    color: var(--text-secondary);
    max-width: 280px;
    margin: 0 auto;
    line-height: 1.5;
}
