/* ================================
   Goals Section (bottom of summary)
   ================================ */

#goalsSection {
    /*margin-top: 24px;
    margin-bottom: 12px;*/
}

.goals-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.goals-section-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ci-dark), var(--ci-light, #3b6cb7));
    color: var(--white);
    font-size: 16px;
}

.goals-section-header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--grey-900);
}

/* Layout: gauge left, cards right */
.goals-section-layout {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.goals-section-left {
    flex: 0 0 260px;
    max-width: 260px;
}

.goals-section-right {
    flex: 1;
    min-width: 0;
}

/* Gauge wrapper */
.goals-section-gauge-wrapper {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--grey-200);
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.goals-section-gauge-title {
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--grey-800);
}

/* Gauge Meter (water-level circular) */
.gauge-meter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.gauge-meter-container {
    position: relative;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--grey-100);
    overflow: hidden;
    border: 3px solid var(--grey-200);
}

.gauge-meter-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: 0 0 50% 50%;
    transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-meter-fill.level-success { background: rgba(76, 175, 80, 0.3); }
.gauge-meter-fill.level-warning { background: rgba(255, 167, 38, 0.3); }
.gauge-meter-fill.level-danger  { background: rgba(229, 57, 53, 0.3); }

.gauge-meter-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.gauge-meter-percentage {
    font-size: 28px;
    font-weight: 800;
    color: var(--grey-900);
    line-height: 1;
}

.gauge-meter-label {
    font-size: 11px;
    color: var(--grey-500);
    margin-top: 4px;
}

.gauge-meter-stats {
    display: flex;
    gap: 24px;
    justify-content: center;
}

.gauge-meter-stat {
    text-align: center;
}

.gauge-meter-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--grey-900);
}

.gauge-meter-stat-label {
    font-size: 11px;
    color: var(--grey-500);
}

/* Goal Cards Grid */
.goals-section-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    height: 100%;
}

.goal-card {
    background: var(--white);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid var(--grey-200);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: goalCardFadeIn 0.3s ease both;
    text-align: center;
}

@keyframes goalCardFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.goal-card-header {
    width: 100%;
}

.goal-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--grey-900);
    margin: 0;
    line-height: 1.3;
}

.goal-card-timeframe {
    font-size: 10px;
    font-weight: 500;
    color: var(--grey-700);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px solid var(--grey-100);
    width: 100%;
}

.goal-card-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.goal-card-brand {
    font-size: 12px;
    color: var(--grey-700);
    background: var(--grey-100);
    padding: 2px 8px;
    border-radius: 6px;
}

.goal-card-module-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--ci-dark);
    background: rgba(20, 56, 116, 0.08);
    padding: 2px 8px;
    border-radius: 6px;
}

/* Circular gauge inside goal cards */
.goal-card-gauge {
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.goal-card-gauge-container {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--grey-100);
    overflow: hidden;
    border: 2px solid var(--grey-200);
}

.goal-card-gauge-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: 0 0 50% 50%;
    transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.goal-card-gauge-fill.level-success { background: rgba(76, 175, 80, 0.3); }
.goal-card-gauge-fill.level-warning { background: rgba(255, 167, 38, 0.3); }
.goal-card-gauge-fill.level-danger  { background: rgba(229, 57, 53, 0.3); }

.goal-card-gauge-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.goal-card-gauge-percentage {
    font-size: 20px;
    font-weight: 800;
    color: var(--grey-900);
    line-height: 1;
}

/* Progress bar inside cards - DEPRECATED, now using circular gauge */
.goal-card-progress {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.goal-card-progress-bar {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--grey-200);
    overflow: hidden;
}

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

.goal-card-progress-fill.level-success { background: var(--accent-pos-dark); }
.goal-card-progress-fill.level-warning { background: #FFA726; }
.goal-card-progress-fill.level-danger  { background: #E53935; }

.goal-card-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.goal-card-progress-percentage {
    font-size: 13px;
    font-weight: 700;
    color: var(--grey-800);
}

.goal-card-progress-values {
    font-size: 11px;
    color: var(--grey-500);
}

/* Stat boxes inside card */
.goal-card-stats {
    display: flex;
    gap: 12px;
}

.goal-card-stat {
    flex: 1;
    background: var(--grey-50, #fafafa);
    padding: 6px 10px;
    border-radius: 8px;
    text-align: center;
}

.goal-card-stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--grey-900);
}

.goal-card-stat-label {
    font-size: 10px;
    color: var(--grey-500);
}

/* Contribution line */
.goal-card-contribution {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--grey-500);
    padding-top: 6px;
    border-top: 1px solid var(--grey-100);
}

.goal-card-contribution-icon {
    font-size: 11px;
}

/* Empty state */
.goals-section-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 48px 20px;
    text-align: center;
    color: var(--grey-500);
}

.goals-section-empty-icon {
    font-size: 40px;
    color: var(--grey-300);
}

.goals-section-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--grey-700);
}

.goals-section-empty-text {
    font-size: 13px;
    max-width: 360px;
}

/* Responsive: stack gauge + cards vertically */
@media (max-width: 768px) {
    .goals-section-layout {
        flex-direction: column;
    }

    .goals-section-left {
        flex: none;
        max-width: 100%;
        width: 100%;
    }

    .goals-section-cards {
        grid-template-columns: 1fr;
    }
}
