/* ===== LIFEPLAN YEAR EDITOR ===== */

/* Fixed Header */
.lpy-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #1e3a5f;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    gap: 16px;
}

/* Left group: Cancel + Title */
.lpy-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Cancel button - grey, matches Save shape */
.lpy-btn-cancel-header {
    background: #6b7280;
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.lpy-btn-cancel-header:hover {
    background: #4b5563;
}

.lpy-title {
    font-size: 15px;
    font-weight: 600;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    white-space: nowrap;
}

/* Right group: Toggle + Helper + Save */
.lpy-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Toggle section */
.lpy-money-mode {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lpy-toggle-switch {
    display: flex;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
}

.lpy-toggle-option {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    transition: all 0.15s ease;
    cursor: pointer;
}

.lpy-toggle-option:hover {
    color: rgba(255,255,255,0.8);
}

.lpy-toggle-option.active {
    background: #f59e0b;
    color: #fff;
}

/* Helper text - white, positioned by active toggle */
.lpy-mode-helper {
    font-size: 12px;
    color: rgba(255,255,255,0.85);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    white-space: nowrap;
}

/* Save button - green */
.lpy-btn-save-header {
    background: #6b7280;
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: not-allowed;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    transition: all 0.15s ease;
    white-space: nowrap;
    opacity: 0.6;
}

.lpy-btn-save-header.lpy-btn-save-dirty {
    background: #10b981;
    cursor: pointer;
    opacity: 1;
}

.lpy-btn-save-header.lpy-btn-save-dirty:hover {
    background: #059669;
}

/* Content Area - 20px gap after header */
.lpy-content {
    background: #f5f5f5;
    min-height: 100vh;
    padding: 70px 0 40px 0; /* 70px = 50px header + 20px gap */
}

.lpy-form {
    max-width: 700px;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Mode banner - warm yellow with lightbulb */
.lpy-mode-banner {
    padding: 12px 24px;
    background: #fef3c7;
    border-bottom: 1px solid #fcd34d;
    font-size: 13px;
    color: #92400e;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
}

.lpy-mode-banner i {
    color: #f59e0b;
}

.lpy-mode-banner strong {
    color: #78350f;
}

/* Fields */
.lpy-field {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
}

.lpy-field:last-child {
    border-bottom: none;
}

.lpy-field-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.lpy-field-label {
    flex: 1;
    padding-right: 16px;
}

.lpy-label {
    font-size: 15px;
    font-weight: 700;
    display: block;
    margin-bottom: 3px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Chart-matching label colors */
.lpy-label-green {
    color: #22c55e;
}

.lpy-label-red {
    color: #ef4444;
}

.lpy-label-black {
    color: #1f2937;
}

.lpy-label-blue {
    color: #3b82f6;
}

.lpy-hint {
    font-size: 12px;
    color: #6b7280;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.4;
}

.lpy-field-value {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Input wrapper - for positioning reset icon inside */
.lpy-input-wrapper {
    position: relative;
    display: inline-block;
}

.lpy-input {
    width: 110px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    text-align: right;
    background: #fff;
}

.lpy-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.lpy-input-wide {
    width: 130px;
}

/* Override style - matches table exactly */
.lpy-input-override {
    background: rgba(251, 191, 36, 0.15);
    border-color: #f59e0b;
    border-width: 2px;
    padding-left: 22px; /* Make room for reset icon */
}

/* Reset icon inside input - matches table */
.lpy-input-reset {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #9ca3af;
    cursor: pointer;
    z-index: 2;
    transition: all 0.15s ease;
}

.lpy-input-reset:hover {
    color: #f59e0b;
}

.lpy-previous {
    font-size: 11px;
    color: #9ca3af;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    white-space: nowrap;
}

/* Note section */
.lpy-field-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.lpy-note {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    resize: none;
    min-height: 50px;
    background: #fafafa;
}

.lpy-note:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
}

.lpy-note::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.lpy-note-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lpy-btn-mic,
.lpy-btn-ai {
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.15s ease;
}

.lpy-btn-mic:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.lpy-btn-ai:hover {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: #fff;
}

/* Responsive */
@media (max-width: 1200px) {
    .lpy-mode-helper {
        display: none;
    }
}

@media (max-width: 992px) {
    .lpy-header {
        flex-wrap: wrap;
        padding: 10px 16px;
    }

    .lpy-header-left {
        order: -1;
        width: 100%;
        justify-content: flex-start;
        margin-bottom: 8px;
    }

    .lpy-header-right {
        width: 100%;
        justify-content: space-between;
    }

    .lpy-content {
        padding: 110px 0 40px 0;
    }
}

@media (max-width: 768px) {
    .lpy-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .lpy-content {
        padding: 130px 0 40px 0;
    }

    .lpy-field {
        padding: 16px;
    }

    .lpy-field-main {
        flex-direction: column;
        gap: 10px;
    }

    .lpy-field-value {
        width: 100%;
    }

    .lpy-input-wrapper {
        flex: 1;
    }

    .lpy-input {
        width: 100%;
    }

    .lpy-field-note {
        flex-direction: column;
    }

    .lpy-note-actions {
        flex-direction: row;
    }
}

.lpy-unsaved-indicator {
    font-size: 12px;
    color: #fbbf24;
    font-weight: 500;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    white-space: nowrap;
    animation: pulse 2s infinite;
}

.lpy-unsaved-indicator i {
    font-size: 8px;
    vertical-align: middle;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
