/* ============================================
   GOALS — Cele oszczędnościowe
   ============================================ */

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

/* ── Karta celu ─────────────────────────────── */
.goal-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--goal-color, var(--red-primary));
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--glass-shadow);
}
.goal-card:active {
  transform: scale(0.985);
}
.goal-card.done {
  opacity: 0.6;
}

/* ── Header karty ───────────────────────────── */
.goal-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.goal-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--goal-color, var(--red-primary)) 15%, transparent);
  color: var(--goal-color, var(--red-primary));
}
.goal-icon .material-symbols-rounded {
  font-size: 22px;
}
.goal-card-info {
  flex: 1;
  min-width: 0;
}
.goal-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.goal-deadline {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.goal-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, transparent);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  flex-shrink: 0;
}

/* ── Pasek postępu ──────────────────────────── */
.goal-progress-track {
  height: 6px;
  background: var(--glass-border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--space-2);
}
.goal-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
  background: var(--goal-color, var(--red-primary));
}
.goal-progress-fill.warning {
  background: var(--yellow);
}
.goal-progress-fill.complete {
  background: var(--green);
  animation: goalPulse 1.8s ease-in-out infinite;
}

@keyframes goalPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

/* ── Kwoty ──────────────────────────────────── */
.goal-amounts {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}
.goal-saved {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}
.goal-target {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.goal-pct {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--goal-color, var(--red-primary));
  flex-shrink: 0;
}

/* ── Przycisk wpłaty ────────────────────────── */
.goal-deposit-btn {
  margin-top: var(--space-3);
  width: 100%;
  padding: 0.5rem;
  border: 1.5px solid var(--goal-color, var(--red-primary));
  background: transparent;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--goal-color, var(--red-primary));
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.goal-deposit-btn:hover {
  background: color-mix(in srgb, var(--goal-color, var(--red-primary)) 10%, transparent);
}
.goal-card.done .goal-deposit-btn {
  display: none;
}

/* ── Empty state ────────────────────────────── */
.goals-empty {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-muted);
}
.goals-empty .material-symbols-rounded {
  font-size: 52px;
  display: block;
  margin-bottom: 0.75rem;
  opacity: 0.35;
}
.goals-empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.goals-empty-sub {
  font-size: 0.82rem;
  margin-bottom: 1.5rem;
}

/* ── Sheet celu — formularz ─────────────────── */
.goal-icon-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.goal-icon-btn {
  width: 100%;
  height: 44px;
  border: 2px solid var(--glass-border);
  border-radius: 10px;
  background: var(--glass-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-secondary);
}
.goal-icon-btn .material-symbols-rounded {
  font-size: 20px;
}
.goal-icon-btn.selected {
  border-color: var(--red-primary);
  background: color-mix(in srgb, var(--red-primary) 12%, transparent);
  color: var(--red-primary);
}

/* ── Meta row (deadline + liczba wpłat) ─────── */
.goal-meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: 2px;
}
.goal-deposit-count {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 1px 6px;
}

/* ── Deposit sheet ──────────────────────────── */
.goal-deposit-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.goal-deposit-current {
  text-align: center;
  padding: var(--space-3) 0;
}
.goal-deposit-current-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.goal-deposit-current-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* ── Wybór trybu wpłaty ─────────────────────── */
.goal-deposit-modes {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.goal-deposit-mode {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  background: transparent;
}
.goal-deposit-mode .material-symbols-rounded {
  font-size: 22px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 1px;
}
.goal-deposit-mode.active {
  border-color: var(--red-primary);
  background: color-mix(in srgb, var(--red-primary) 6%, transparent);
}
.goal-deposit-mode.active .material-symbols-rounded {
  color: var(--red-primary);
}
.goal-mode-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.goal-mode-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Historia wpłat (w edit sheet) ─────────── */
.goal-history-section {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--glass-border);
}
.goal-history-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-3);
}
.goal-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--glass-border);
}
.goal-history-row:last-child {
  border-bottom: none;
}
.goal-history-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.goal-history-amount {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}
.goal-history-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.goal-history-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: var(--transition-fast);
  flex-shrink: 0;
}
.goal-history-delete:hover {
  color: var(--color-expense);
  background: color-mix(in srgb, var(--color-expense) 10%, transparent);
}
.goal-history-delete .material-symbols-rounded {
  font-size: 18px;
}

/* ── Usuń cel z karty ──────────────────────── */
.goal-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: var(--transition-fast);
}
.goal-delete-btn:hover {
  color: var(--color-expense);
  background: color-mix(in srgb, var(--color-expense) 10%, transparent);
}
.goal-delete-btn .material-symbols-rounded {
  font-size: 18px;
}
