/* ── Objectifs ───────────────────────────────────────────────────────────── */

.goals-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 0.75rem 4rem;
}

.goals-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0.25rem 0.75rem;
    gap: 0.5rem;
}

.goals-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.goals-back {
    font-size: 0.85rem;
    color: #6c5ce7;
    text-decoration: none;
    font-weight: 600;
}

.goals-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.goals-create-btn {
    background: #6c5ce7;
    color: #fff;
    border-radius: 20px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    min-height: 36px;
    display: flex;
    align-items: center;
}

.goals-edit-btn {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    text-decoration: none;
    min-height: 36px;
    display: flex;
    align-items: center;
}

.goals-delete-btn {
    font-size: 0.82rem;
    color: #94a3b8;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.35rem 0.55rem;
    text-decoration: none;
    min-height: 36px;
    display: flex;
    align-items: center;
    transition: color 0.15s, background 0.15s;
}
.goals-delete-btn:hover { color: #dc2626; background: #fee2e2; border-color: #fca5a5; }

.goals-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin: 1.25rem 0 0.5rem 0.25rem;
}

.goals-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
    padding: 2rem 0;
    line-height: 1.6;
}

/* Cartes liste */
.goals-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.goal-card {
    display: block;
    background: #fff;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    text-decoration: none;
    color: inherit;
    border-left: 4px solid #6c5ce7;
    transition: box-shadow 0.15s;
}

.goal-card.done {
    border-left-color: #00b894;
    opacity: 0.65;
}

.goal-card:active { box-shadow: 0 2px 8px rgba(108,92,231,0.15); }

.goal-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.goal-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    flex: 1;
}

.goal-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    background: #f0f0f0;
    color: #555;
    white-space: nowrap;
}
.goal-badge.today { background: #6c5ce7; color: #fff; }
.goal-badge.soon  { background: #fdcb6e; color: #333; }
.goal-badge.overdue { background: #e17055; color: #fff; }

/* Barre de progression */
.goal-progress-wrap { margin-top: 0.25rem; }

.goal-progress-track {
    position: relative;
    height: 8px;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
}

.goal-progress-track.large { height: 14px; border-radius: 8px; }

.goal-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #6c5ce7;
    border-radius: 6px;
}


.goal-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.2rem;
}

/* Détail */
.goal-detail-card {
    background: #fff;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 0.75rem;
    border-left: 4px solid #6c5ce7;
}

.goal-detail-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.goal-detail-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    flex: 1;
}

.goal-detail-title.done { text-decoration: line-through; opacity: 0.6; }

.goal-done-btn {
    font-size: 0.8rem;
    font-weight: 600;
    border: 1.5px solid #6c5ce7;
    color: #6c5ce7;
    background: transparent;
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    min-height: 34px;
}
.goal-done-btn.done { background: #00b894; border-color: #00b894; color: #fff; }

.goal-detail-desc {
    font-size: 0.9rem;
    color: #555;
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

.goal-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.goal-meta-item {
    font-size: 0.78rem;
    color: #888;
    background: #f8fafc;
    border-radius: 20px;
    padding: 0.2rem 0.6rem;
}

/* Blocs finance et étapes */
.goal-finance-block,
.goal-steps-block {
    background: #fff;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 0.75rem;
}

.goal-finance-header,
.goal-steps-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.goal-finance-header h3,
.goal-steps-header h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
}

.goal-finance-total,
.goal-steps-progress {
    font-size: 0.85rem;
    font-weight: 700;
    color: #6c5ce7;
}

.goal-finance-pct {
    font-size: 0.78rem;
    color: #888;
    margin: 0.3rem 0 0.75rem;
}

/* Contributions */
.goal-contrib-list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
}

.goal-contrib-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
}

.goal-contrib-item:last-child { border-bottom: none; }

.goal-contrib-date { color: #888; min-width: 30px; }
.goal-contrib-amount { font-weight: 700; color: #00b894; }
.goal-contrib-note { flex: 1; color: #555; }
.goal-contrib-who { font-size: 0.72rem; color: #aaa; }

.goal-contrib-delete { margin-left: auto; }
.goal-contrib-del-btn {
    background: none; border: none; color: #ccc; font-size: 1rem;
    cursor: pointer; padding: 0.1rem 0.3rem; line-height: 1;
}
.goal-contrib-del-btn:hover { color: #e17055; }

/* Étapes */
.goal-steps-list {
    list-style: none;
    margin: 0.5rem 0;
    padding: 0;
}

.goal-step {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.goal-step:last-child { border-bottom: none; }

.goal-step.done .goal-step-title {
    text-decoration: line-through;
    opacity: 0.5;
}

.goal-step-toggle { margin: 0; }

.goal-step-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #6c5ce7;
    background: transparent;
    color: #6c5ce7;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.goal-step.done .goal-step-check {
    background: #00b894;
    border-color: #00b894;
    color: #fff;
}

.goal-step-title { flex: 1; font-size: 0.9rem; font-weight: 500; }

.goal-step-del-form { margin: 0; }
.goal-step-del-btn {
    background: none; border: none; color: #ccc; font-size: 1.1rem;
    cursor: pointer; padding: 0.1rem 0.3rem; line-height: 1;
}
.goal-step-del-btn:hover { color: #e17055; }

/* Formulaire ajout inline */
.goal-add-details {
    margin-top: 0.75rem;
}

.goal-add-summary {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c5ce7;
    cursor: pointer;
    list-style: none;
    padding: 0.4rem 0;
    min-height: 36px;
    display: flex;
    align-items: center;
}
.goal-add-summary::-webkit-details-marker { display: none; }

.goal-add-form {
    padding: 0.5rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.goal-add-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.goal-input {
    flex: 1;
    min-width: 0;
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #334155;
    min-height: 44px;
}

.goal-input-full { width: 100%; }

.goal-submit-btn {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    border: none;
    background: #6c5ce7;
    color: #fff;
    cursor: pointer;
    min-height: 44px;
    white-space: nowrap;
}

/* Formulaire création/édition */
.goal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.25rem;
}

.goal-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.goal-form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #555;
}

.goal-form-input {
    font-size: 1rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #334155;
    min-height: 44px;
    width: 100%;
    box-sizing: border-box;
}

.goal-form-textarea { min-height: 90px; resize: vertical; }

.goal-form-row {
    display: flex;
    gap: 0.75rem;
}

.goal-form-row .goal-form-group { flex: 1; }

.goal-form-radios {
    display: flex;
    gap: 1rem;
}

.goal-radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    min-height: 44px;
    padding: 0.25rem 0.75rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    flex: 1;
    user-select: none;
}

.goal-radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    cursor: pointer;
    accent-color: #6c5ce7;
    flex-shrink: 0;
    pointer-events: auto;
}

.goal-radio-label:has(input[type="radio"]:checked) {
    background: #ede9fe;
    border-color: #6c5ce7;
    color: #4c3db8;
    font-weight: 700;
}

.goal-steps-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.goal-form-submit {
    font-size: 1rem;
    font-weight: 700;
    padding: 0.75rem;
    border-radius: 10px;
    border: none;
    background: #6c5ce7;
    color: #fff;
    cursor: pointer;
    min-height: 48px;
    margin-top: 0.5rem;
}

/* Suppression */
.goal-delete-card {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-top: 1rem;
    text-align: center;
}

.goal-delete-card h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.goal-delete-card p { font-size: 0.9rem; color: #555; margin-bottom: 1.25rem; line-height: 1.5; }

.goal-delete-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.goal-delete-confirm-btn {
    background: #e17055;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 44px;
    width: 100%;
    max-width: 280px;
}

.goal-delete-cancel {
    font-size: 0.85rem;
    color: #888;
    text-decoration: none;
}

@media (max-width: 480px) {
    .goal-form-row { flex-direction: column; }
}
