/**
 * Goals v3 — intent & progress
 */
body.zl-goals-v3 {
    --zl-goals-canvas: #f4f4f8;
    --zl-goals-card: #ffffff;
    --zl-goals-accent: #7da82a;
    --zl-goals-lime: #c9ff57;
}

body.zl-goals-v3 .zl-atmosphere {
    display: none;
}

body.zl-goals-v3 .dashboard {
    min-height: 100vh;
    background: var(--zl-goals-canvas);
}

body.zl-goals-v3 .main-content {
    padding: 1.35rem 1.75rem 2rem !important;
    max-width: none !important;
    background: var(--zl-goals-canvas);
}

.zl-goals-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.zl-goals-v3 .zl-goals-top .zl-display {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.5rem);
    color: #1a1a1f;
}

.zl-goals-v3 .zl-goals-top .zl-display em {
    font-style: italic;
    color: var(--zl-goals-accent);
}

.zl-goals-tagline {
    margin: 0.5rem 0 0;
    font-size: 1rem;
    color: #6b7280;
    max-width: 38rem;
}

.zl-goals-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 1.15rem;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: #0a0a0c;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--zl-goals-lime), var(--zl-goals-accent));
    box-shadow: 0 6px 20px rgba(125, 168, 42, 0.35);
    flex-shrink: 0;
    transition: transform 0.15s, opacity 0.15s;
}

.zl-goals-add-btn:hover {
    transform: translateY(-1px);
}

.zl-goals-add-btn [data-lucide] {
    width: 18px;
    height: 18px;
}

/* Stats */
.zl-goals-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.zl-goals-stat {
    background: var(--zl-goals-card);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.zl-goals-stat-num {
    font-family: var(--font-serif, 'Instrument Serif', Georgia, serif);
    font-size: 1.75rem;
    color: #1a1a1f;
    line-height: 1.1;
}

.zl-goals-stat-lbl {
    margin-top: 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #9ca3af;
}

/* Layout */
.zl-goals-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 1.25rem;
    align-items: start;
}

.zl-goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

/* Goal card */
.zl-goal-card {
    background: var(--zl-goals-card);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    padding: 1.15rem 1.2rem 1.1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}

.zl-goal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.07);
}

.zl-goal-card.completed {
    opacity: 0.82;
}

.zl-goal-card-head {
    display: flex;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.zl-goal-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    background: rgba(201, 255, 87, 0.2);
}

.zl-goal-icon.fitness,
.zl-goal-icon.health {
    background: rgba(255, 126, 179, 0.15);
}

.zl-goal-icon.finance {
    background: rgba(255, 209, 102, 0.2);
}

.zl-goal-icon.career {
    background: rgba(110, 181, 255, 0.15);
}

.zl-goal-icon.learning {
    background: rgba(167, 139, 250, 0.15);
}

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

.zl-goal-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.zl-goal-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 600;
    color: #1a1a1f;
    line-height: 1.3;
}

.zl-goal-status {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.zl-goal-status.on-track {
    background: rgba(201, 255, 87, 0.25);
    color: #4a6b15;
}

.zl-goal-status.progress {
    background: rgba(110, 181, 255, 0.15);
    color: #1d4ed8;
}

.zl-goal-status.focus {
    background: rgba(251, 191, 36, 0.2);
    color: #92400e;
}

.zl-goal-status.done {
    background: #f3f4f6;
    color: #6b7280;
}

.zl-goal-meta {
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: #9ca3af;
    text-transform: capitalize;
}

.zl-goal-desc {
    margin: 0 0 0.85rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #6b7280;
}

.zl-goal-progress-wrap {
    margin-bottom: 0.75rem;
}

.zl-goal-progress-top {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    margin-bottom: 0.35rem;
}

.zl-goal-progress-top span:first-child {
    color: #6b7280;
}

.zl-goal-progress-top strong {
    color: #1a1a1f;
    font-weight: 600;
}

.zl-goal-bar {
    height: 8px;
    border-radius: 999px;
    background: #f3f4f6;
    overflow: hidden;
}

.zl-goal-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--zl-goals-lime), var(--zl-goals-accent));
    transition: width 0.4s ease;
}

.zl-goal-deadline {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #9ca3af;
    margin-bottom: 0.75rem;
}

.zl-goal-deadline [data-lucide] {
    width: 14px;
    height: 14px;
}

.zl-goal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.zl-goal-btn {
    padding: 0.4rem 0.75rem;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    color: #374151;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.zl-goal-btn:hover {
    background: #fff;
    border-color: var(--zl-goals-accent);
}

.zl-goal-btn.primary {
    color: #0a0a0c;
    background: rgba(201, 255, 87, 0.35);
    border-color: rgba(125, 168, 42, 0.35);
}

.zl-goal-add-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border: 2px dashed rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    background: transparent;
    cursor: pointer;
    color: #9ca3af;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.zl-goal-add-card:hover {
    border-color: var(--zl-goals-accent);
    color: var(--zl-goals-accent);
    background: rgba(201, 255, 87, 0.06);
}

.zl-goal-add-card [data-lucide] {
    width: 28px;
    height: 28px;
    margin-bottom: 0.5rem;
}

/* Rail */
.zl-goals-rail {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    position: sticky;
    top: 1rem;
}

.zl-goals-rail-card {
    background: var(--zl-goals-card);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.zl-goals-rail-card h3 {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
}

.zl-goals-rail-card p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.55;
    color: #6b7280;
}

.zl-goals-insight {
    background: linear-gradient(160deg, rgba(201, 255, 87, 0.15) 0%, #fff 50%);
}

/* Empty */
.zl-goals-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    background: var(--zl-goals-card);
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.zl-goals-empty h3 {
    margin: 0 0 0.5rem;
    font-family: var(--font-serif, 'Instrument Serif', Georgia, serif);
    font-size: 1.5rem;
    color: #1a1a1f;
}

.zl-goals-empty p {
    margin: 0 auto 1.25rem;
    max-width: 360px;
    color: #6b7280;
    font-size: 0.95rem;
}

/* Modal */
body.zl-goals-v3 .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(10, 10, 12, 0.45);
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

body.zl-goals-v3 .modal-overlay.active {
    display: flex;
}

body.zl-goals-v3 .modal-content {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
    position: relative;
}

body.zl-goals-v3 .modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
    background: #f3f4f6;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    color: #6b7280;
}

body.zl-goals-v3 .modal-title {
    margin: 0 0 1.25rem;
    font-family: var(--font-serif, 'Instrument Serif', Georgia, serif);
    font-size: 1.65rem;
    color: #1a1a1f;
}

body.zl-goals-v3 .form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #374151;
}

body.zl-goals-v3 .form-input,
body.zl-goals-v3 .form-select,
body.zl-goals-v3 .form-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 0.9rem;
    font-family: inherit;
    font-size: 0.95rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #1a1a1f;
}

body.zl-goals-v3 .form-textarea {
    min-height: 80px;
    resize: vertical;
}

body.zl-goals-v3 .form-group {
    margin-bottom: 1rem;
}

body.zl-goals-v3 .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

body.zl-goals-v3 .form-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

body.zl-goals-v3 .modal-actions {
    display: flex;
    gap: 0.65rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

body.zl-goals-v3 .modal-actions .btn-primary {
    background: linear-gradient(135deg, var(--zl-goals-lime), var(--zl-goals-accent));
    color: #0a0a0c;
    border: none;
    border-radius: 10px;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
}

body.zl-goals-v3 .modal-actions .btn-ghost {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.65rem 1.25rem;
    cursor: pointer;
    color: #374151;
}

@media (max-width: 1024px) {
    .zl-goals-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .zl-goals-layout {
        grid-template-columns: 1fr;
    }

    .zl-goals-rail {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .zl-goals-stats {
        grid-template-columns: 1fr 1fr;
    }

    .zl-goals-rail {
        grid-template-columns: 1fr;
    }

    body.zl-goals-v3 .form-row {
        grid-template-columns: 1fr;
    }
}
