:root {
    --primary-color: #0d1b2a;
    --primary-dark: #1b2838;
    --secondary-color: #4ecdc4;
    --secondary-dark: #3dbdb5;
    --accent-teal: #00b8a9;
    --accent-teal-dark: #009688;
    --primary-navy: #1a237e;
    --text-primary: #333;
    --text-light: #666;
    --border-color: #e2e8f0;
    --bg-light: #f7fafc;
    --bg-hover: #edf2f7;
    --bg-active: #ebf8ff;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    /* Enhanced rounded corners for modern look */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
}

.container {
    max-width: 1800px;
    width: 95vw;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    font-weight: 700;
}

header p {
    font-size: 1rem;
    opacity: 0.85;
}

main {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 1000px) {
    main {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.form-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 85vh;
    overflow-y: auto;
}

.accordion {
    margin-bottom: 15px;
}

.accordion-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f7fafc;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.accordion-header:hover {
    background: #edf2f7;
}

.accordion-header.active {
    background: #ebf8ff;
    border-bottom: 1px solid #e2e8f0;
}

.accordion-header h3 {
    color: #2d3748;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

.accordion-icon {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--secondary-color);
    width: 24px;
    text-align: center;
}

.accordion-content {
    padding: 15px;
    display: none;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group.half {
    flex: 1;
}

.form-group.third {
    flex: 1;
    min-width: 120px;
}

.child-entry,
.milestone-entry {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    position: relative;
}

.child-entry:first-child .btn-remove-item,
.milestone-entry:first-child .btn-remove-item {
    display: none;
}

.btn-add-item {
    background: transparent;
    color: var(--secondary-color);
    border: 2px dashed var(--secondary-color);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 10px;
}

.btn-add-item:hover {
    background: rgba(78, 205, 196, 0.1);
    border-style: solid;
}

.btn-remove-item {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f56565;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
}

.btn-remove-item:hover {
    background: #e53e3e;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.btn-preset {
    background: linear-gradient(135deg, #0d1b2a 0%, #1a3a5c 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-preset:hover {
    background: linear-gradient(135deg, #1a3a5c 0%, #0d1b2a 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.form-group input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #f7fafc;
}

.form-group input[type="number"]:focus {
    outline: none;
    border-color: var(--secondary-color);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #718096;
    font-size: 0.8rem;
}

.checkbox-group {
    margin-bottom: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    color: #4a5568;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--secondary-color);
    cursor: pointer;
}

.conditional-section {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    border-left: 3px solid var(--secondary-color);
}

.info-box {
    background: #ebf8ff;
    border: 1px solid #90cdf4;
    border-radius: 6px;
    padding: 12px;
    font-size: 0.85rem;
    color: #3db9b0;
    line-height: 1.5;
    margin-bottom: 15px;
}

.calculate-btn {
    width: 100%;
    background: linear-gradient(135deg, #3db9b0 0%, #0d1b2a 100%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 10px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(43, 108, 176, 0.4);
}

.calculate-btn:active {
    transform: translateY(0);
}

.results-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.result-summary {
    margin-bottom: 25px;
}

.result-summary h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-align: center;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 15px;
}

.tab-btn {
    padding: 10px 18px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: #edf2f7;
}

.tab-btn.active {
    background: #3db9b0;
    color: white;
    border-color: #3db9b0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content h4 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.result-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.result-card {
    padding: 18px;
    border-radius: 10px;
    text-align: center;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
}

.result-card.primary {
    background: linear-gradient(135deg, #3db9b0 0%, #0d1b2a 100%);
    color: white;
    border: none;
}

.result-card.secondary {
    background: linear-gradient(135deg, #38a169 0%, #276749 100%);
    color: white;
    border: none;
}

.result-card.tertiary {
    background: linear-gradient(135deg, #805ad5 0%, #553c9a 100%);
    color: white;
    border: none;
}

.result-card.info {
    background: #ebf8ff;
    border: 2px solid #90cdf4;
    color: #3db9b0;
}

.result-card.success {
    background: #f0fff4;
    border: 2px solid #9ae6b4;
    color: #276749;
}

.result-card.highlight {
    background: linear-gradient(135deg, #d69e2e 0%, #b7791f 100%);
    color: white;
    border: none;
}

.card-label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 8px;
}

.card-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
}

.result-card.info .card-value {
    color: var(--primary-color);
}

.result-card.success .card-value {
    color: #22543d;
}

.scenarios-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.scenario-card {
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.scenario-card.pessimistic {
    background: linear-gradient(135deg, #fc8181 0%, #c53030 100%);
    color: white;
}

.scenario-card.realistic {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: white;
}

.scenario-card.optimistic {
    background: linear-gradient(135deg, #68d391 0%, #38a169 100%);
    color: white;
}

.scenario-label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 8px;
    opacity: 0.9;
}

.scenario-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
}

.status-box {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.status-box.success {
    background: #f0fff4;
    border-left: 4px solid #38a169;
    color: #276749;
}

.status-box.warning {
    background: #fffaf0;
    border-left: 4px solid #dd6b20;
    color: #c05621;
}

.breakdown-section {
    background: #f7fafc;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.breakdown-section h4 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1rem;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.breakdown-label {
    color: #718096;
    font-size: 0.9rem;
}

.breakdown-value {
    font-weight: 600;
    color: #2d3748;
}

.chart-container {
    margin-top: 25px;
    background: #f7fafc;
    border-radius: 10px;
    padding: 20px;
    min-height: 400px;
}

#savings-chart {
    width: 100%;
    height: 400px;
}

.timeline-table-section {
    margin-top: 25px;
}

.timeline-table-section h4 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1rem;
}

.table-container {
    max-height: 300px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

#timeline-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

#timeline-table th {
    background: #2d3748;
    color: white;
    padding: 12px 15px;
    text-align: left;
    position: sticky;
    top: 0;
    font-weight: 600;
}

#timeline-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #e2e8f0;
}

#timeline-table tbody tr:nth-child(even) {
    background: #f7fafc;
}

#timeline-table tbody tr:hover {
    background: #ebf8ff;
}

.report-section {
    margin-top: 25px;
    text-align: center;
}

.report-btn {
    background: linear-gradient(135deg, #805ad5 0%, #553c9a 100%);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.report-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(128, 90, 213, 0.4);
}

.loading {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.chart-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.chart-tab-btn {
    padding: 8px 16px;
    background: #edf2f7;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: #4a5568;
    transition: all 0.2s ease;
}

.chart-tab-btn:hover {
    background: #e2e8f0;
}

.chart-tab-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.chart-tab-content {
    display: none;
}

.chart-tab-content.active {
    display: block;
}

.gauge-container {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.gauge-container h5 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 1rem;
}

.gauge {
    position: relative;
    height: 30px;
    background: linear-gradient(to right, #28a745 0%, #28a745 43%, #ffc107 43%, #ffc107 56%, #dc3545 56%, #dc3545 100%);
    border-radius: 15px;
    overflow: hidden;
    max-width: 400px;
    margin: 0 auto;
}

.gauge-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary-color);
    transition: left 0.5s ease;
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    max-width: 400px;
    margin: 8px auto 0;
    font-size: 0.8rem;
    color: #718096;
}

.gauge-status {
    margin-top: 10px;
    font-weight: 600;
    font-size: 1.1rem;
}

.gauge-status.safe {
    color: #28a745;
}

.gauge-status.moderate {
    color: #ffc107;
}

.gauge-status.risky {
    color: #dc3545;
}

.info-box.warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.result-card.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.result-card.highlight .card-label {
    color: rgba(255, 255, 255, 0.85);
}

.scenario-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.scenario-card {
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.scenario-card.pessimistic {
    background: #fff5f5;
    border: 2px solid #dc3545;
}

.scenario-card.realistic {
    background: #f0f9ff;
    border: 2px solid #3db9b0;
}

.scenario-card.optimistic {
    background: #f0fff4;
    border: 2px solid #28a745;
}

.scenario-label {
    display: block;
    font-size: 0.85rem;
    color: #4a5568;
    margin-bottom: 5px;
}

.scenario-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
}

.scenario-card.pessimistic .scenario-value {
    color: #dc3545;
}

.scenario-card.realistic .scenario-value {
    color: #3db9b0;
}

.scenario-card.optimistic .scenario-value {
    color: #28a745;
}

@media (max-width: 768px) {
    .scenario-cards {
        grid-template-columns: 1fr;
    }
}

.spinner {
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3db9b0;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #718096;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .scenarios-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
        text-align: center;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .accordion-header {
        min-height: 50px;
        padding: 12px 15px;
    }
    
    .calculate-btn {
        min-height: 50px;
    }
    
    .checkbox-label {
        min-height: 44px;
        padding: 8px 0;
    }
    
    .checkbox-label input[type="checkbox"] {
        width: 22px;
        height: 22px;
    }
    
    .form-section {
        max-height: none;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.6rem;
    }
    
    .form-section, .results-section {
        padding: 18px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .result-cards {
        grid-template-columns: 1fr;
    }
    
    .breakdown-grid {
        grid-template-columns: 1fr;
    }
    
    .breakdown-item {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding-top: 60px;
    }
    
    header h1 {
        font-size: 1.3rem;
        line-height: 1.3;
    }
    
    header p {
        font-size: 0.85rem;
    }
    
    .form-section, .results-section {
        padding: 15px;
        border-radius: 8px;
        max-height: none;
    }
    
    .accordion-header {
        padding: 12px;
    }
    
    .accordion-header h3 {
        font-size: 0.85rem;
    }
    
    .accordion-content {
        padding: 12px;
    }
    
    .form-group label {
        font-size: 0.85rem;
    }
    
    .form-group input[type="number"] {
        padding: 12px;
        font-size: 16px;
    }
    
    .checkbox-label {
        font-size: 0.9rem;
    }
    
    .calculate-btn {
        padding: 16px;
        font-size: 1rem;
    }
    
    .tab-btn {
        padding: 12px 15px;
        font-size: 0.85rem;
    }
    
    .result-card {
        padding: 15px;
    }
    
    .card-label {
        font-size: 0.8rem;
    }
    
    .card-value {
        font-size: 1.2rem;
    }
    
    .scenario-card {
        padding: 15px;
    }
    
    .scenario-label {
        font-size: 0.8rem;
    }
    
    .scenario-value {
        font-size: 1.3rem;
    }
    
    #timeline-table th,
    #timeline-table td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    .report-btn {
        width: 100%;
        padding: 16px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        padding: 20px;
    }
    
    main {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .form-section {
        max-width: 700px;
        margin: 0 auto;
        max-height: none;
        padding: 30px;
    }
    
    .results-section {
        max-width: 100%;
        padding: 30px;
    }
    
    .result-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .scenarios-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .tabs {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .tab-btn {
        flex: 0 0 auto;
        min-height: 44px;
        padding: 12px 20px;
    }
    
    .accordion-header {
        padding: 15px 18px;
    }
    
    .accordion-content {
        padding: 18px;
    }
    
    .form-row {
        gap: 20px;
    }
}

@media (min-width: 1024px) and (max-width: 1200px) {
    main {
        grid-template-columns: 420px 1fr;
        gap: 25px;
    }
    
    .form-section {
        max-height: 80vh;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .form-section {
        max-height: 70vh;
    }
    
    header {
        margin-bottom: 15px;
    }
    
    header h1 {
        font-size: 1.4rem;
        margin-bottom: 5px;
    }
}

@supports (-webkit-touch-callout: none) {
    .form-group input[type="number"] {
        font-size: 16px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .accordion-header:hover {
        background: #f7fafc;
    }
    
    .accordion-header.active:hover {
        background: #ebf8ff;
    }
    
    .calculate-btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    .tab-btn:hover {
        background: #f7fafc;
    }
    
    .tab-btn.active:hover {
        background: #3db9b0;
    }
}
/* Terms and Conditions Page */
.terms-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.terms-container h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 2rem;
}

.terms-container .last-updated {
    color: #718096;
    margin-bottom: 30px;
}

.terms-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.terms-section:last-of-type {
    border-bottom: none;
}

.terms-section h2 {
    color: #2d3748;
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.terms-section h3 {
    color: #4a5568;
    font-size: 1.1rem;
    margin: 20px 0 10px 0;
}

.terms-section p {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 10px;
}

.terms-section ul {
    color: #4a5568;
    line-height: 1.7;
    margin-left: 20px;
    margin-bottom: 15px;
}

.terms-section li {
    margin-bottom: 8px;
}

.warning-box {
    background: #fff5f5;
    border: 2px solid #fc8181;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.warning-box h3 {
    color: #c53030;
    margin: 0 0 10px 0;
}

.warning-box p {
    color: #c53030;
    margin: 0;
}

.cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.cookie-table th,
.cookie-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #e2e8f0;
}

.cookie-table th {
    background: #f7fafc;
    color: #2d3748;
    font-weight: 600;
}

.cookie-table td {
    color: #4a5568;
}

.terms-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.terms-footer a {
    color: #3db9b0;
    text-decoration: none;
}

.terms-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .terms-container {
        margin: 20px;
        padding: 25px;
    }
    
    .terms-container h1 {
        font-size: 1.6rem;
    }
    
    .terms-section h2 {
        font-size: 1.2rem;
    }
    
    .cookie-table {
        font-size: 14px;
    }
    
    .cookie-table th,
    .cookie-table td {
        padding: 8px;
    }
}

/* ========================================
   PC/DESKTOP OPTIMIZATIONS (1200px+)
   Wealth365-style professional dashboard layout
   Scoped to calculator-page only
   ======================================== */

@media (min-width: 1200px) {
    /* Light background for calculator page only */
    body.calculator-page {
        background: #f5f7fa;
    }
    
    body.calculator-page .container {
        max-width: none;
        width: 100%;
        padding: 0;
        background: #f5f7fa;
    }
    
    /* Top navigation bar - horizontal layout */
    body.calculator-page header {
        background: white;
        padding: 15px 40px;
        margin-bottom: 0;
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    }
    
    body.calculator-page header img {
        max-width: 180px;
        margin: 0;
    }
    
    body.calculator-page header p {
        display: none;
    }
    
    body.calculator-page .user-nav {
        position: static;
        gap: 12px;
    }
    
    body.calculator-page .user-nav a {
        background: #f7fafc;
        color: #2d3748;
        border: 1px solid #e2e8f0;
    }
    
    body.calculator-page .user-nav a:hover {
        background: var(--secondary-color);
        color: white;
        border-color: var(--secondary-color);
    }
    
    body.calculator-page .user-nav a.help-link {
        background: var(--secondary-color);
        color: white;
        border-color: var(--secondary-color);
    }
    
    body.calculator-page .user-nav a.admin-link {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }
    
    body.calculator-page .user-nav .user-info {
        color: #2d3748;
        font-weight: 500;
    }
    
    /* Main content layout - only for legacy calculator, not wealth365 layout */
    body.calculator-page:not(.wealth365-layout) main {
        display: grid;
        grid-template-columns: 420px 1fr;
        gap: 0;
        align-items: stretch;
        min-height: calc(100vh - 70px);
    }
    
    /* Sidebar form section */
    body.calculator-page .form-section {
        background: white;
        padding: 25px 30px;
        border-radius: 0;
        box-shadow: 2px 0 8px rgba(0,0,0,0.06);
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        border-right: 1px solid #e2e8f0;
    }
    
    /* Main results area */
    body.calculator-page .results-section {
        background: #f5f7fa;
        padding: 30px 40px;
        border-radius: 0;
        box-shadow: none;
        overflow-y: auto;
        max-height: calc(100vh - 70px);
    }
    
    /* Result cards in horizontal layout */
    body.calculator-page .result-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }
    
    body.calculator-page .result-card {
        padding: 20px;
        background: white;
        border: 1px solid #e2e8f0;
        box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    }
    
    body.calculator-page .result-card.primary,
    body.calculator-page .result-card.secondary,
    body.calculator-page .result-card.tertiary {
        border: none;
    }
    
    body.calculator-page .card-value {
        font-size: 1.5rem;
    }
    
    /* Horizontal tabs - Wealth365 style */
    body.calculator-page .tabs {
        display: flex;
        gap: 4px;
        margin-bottom: 25px;
        background: white;
        padding: 8px;
        border-radius: 10px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.04);
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    body.calculator-page .tab-button {
        padding: 12px 24px;
        font-size: 0.9rem;
        font-weight: 500;
        background: transparent;
        border: none;
        border-radius: 8px;
        color: #64748b;
        white-space: nowrap;
        transition: all 0.2s ease;
    }
    
    body.calculator-page .tab-button:hover {
        background: #f1f5f9;
        color: #2d3748;
    }
    
    body.calculator-page .tab-button.active {
        background: var(--secondary-color);
        color: white;
    }
    
    /* Tab content styling */
    body.calculator-page .tab-content {
        background: white;
        padding: 25px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        border: 1px solid #e2e8f0;
    }
    
    /* Accordion styling for desktop */
    body.calculator-page .accordion-header {
        padding: 16px 18px;
        background: #fafbfc;
    }
    
    body.calculator-page .accordion-header:hover {
        background: #f1f5f9;
    }
    
    body.calculator-page .accordion-header.active {
        background: #e6fffa;
        border-bottom: 1px solid #4ecdc4;
    }
    
    body.calculator-page .accordion-header h3 {
        font-size: 0.95rem;
        color: #1e293b;
    }
    
    body.calculator-page .accordion-content {
        background: white;
    }
    
    body.calculator-page .form-group label {
        font-size: 0.9rem;
        color: #475569;
        font-weight: 500;
    }
    
    body.calculator-page .form-group input,
    body.calculator-page .form-group select {
        padding: 11px 14px;
        font-size: 0.95rem;
        border: 1px solid #e2e8f0;
        background: #fafbfc;
    }
    
    body.calculator-page .form-group input:focus,
    body.calculator-page .form-group select:focus {
        border-color: var(--secondary-color);
        background: white;
        box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.15);
    }
    
    /* Chart container */
    body.calculator-page .chart-container {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        padding: 25px;
    }
    
    /* Scenarios grid */
    body.calculator-page .scenarios-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    body.calculator-page .scenario-card {
        padding: 22px;
        border-radius: 12px;
    }
    
    /* Data tables styling */
    body.calculator-page .timeline-table-section {
        background: white;
        padding: 20px;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
        box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    }
    
    body.calculator-page .timeline-table th {
        background: #f8fafc;
        font-weight: 600;
        color: #334155;
        padding: 14px 16px;
        border-bottom: 2px solid #e2e8f0;
    }
    
    body.calculator-page .timeline-table td {
        padding: 12px 16px;
        border-bottom: 1px solid #f1f5f9;
    }
    
    body.calculator-page .timeline-table tr:hover td {
        background: #f8fafc;
    }
    
    /* Button styling */
    body.calculator-page button[type="submit"],
    body.calculator-page .btn-calculate {
        background: var(--secondary-color);
        padding: 14px 28px;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 10px;
        transition: all 0.2s ease;
    }
    
    body.calculator-page button[type="submit"]:hover,
    body.calculator-page .btn-calculate:hover {
        background: #3db9b0;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(78, 205, 196, 0.35);
    }
    
    /* Breakdown sections */
    body.calculator-page .breakdown-section {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 22px;
    }
    
    body.calculator-page .breakdown-item {
        background: #f8fafc;
        border: 1px solid #e2e8f0;
    }
    
    /* Status boxes */
    body.calculator-page .status-box {
        border-radius: 10px;
        padding: 18px 20px;
    }
}

/* Extra-large desktop screens (1600px+) */
@media (min-width: 1600px) {
    body.calculator-page .container {
        max-width: 100%;
    }
    
    body.calculator-page header {
        padding: 18px 50px;
    }
    
    body.calculator-page header img {
        max-width: 200px;
    }
    
    body.calculator-page main {
        grid-template-columns: 480px 1fr;
    }
    
    body.calculator-page .form-section {
        padding: 30px 35px;
    }
    
    body.calculator-page .results-section {
        padding: 35px 50px;
    }
    
    body.calculator-page .result-cards {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 24px;
    }
    
    body.calculator-page .result-card {
        padding: 24px;
    }
    
    body.calculator-page .card-label {
        font-size: 0.9rem;
    }
    
    body.calculator-page .card-value {
        font-size: 1.6rem;
    }
    
    body.calculator-page .chart-container {
        min-height: 500px;
    }
    
    body.calculator-page #savings-chart {
        height: 480px;
    }
    
    body.calculator-page .tab-button {
        padding: 14px 28px;
        font-size: 0.95rem;
    }
    
    body.calculator-page .tabs {
        padding: 10px;
    }
}

/* Large desktop monitors (1440px+) */
@media (min-width: 1440px) {
    .wealth365-main {
        padding: 24px 32px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr 360px;
        gap: 24px;
        width: 100%;
    }
    
    .dashboard-chart-area {
        padding: 20px;
    }
    
    .dashboard-main-chart {
        height: 450px;
    }
    
    .dashboard-category-tabs {
        gap: 8px;
    }
    
    .category-tab {
        padding: 12px 20px;
    }
}

/* Ultra-wide/4K monitors (1920px+) */
@media (min-width: 1920px) {
    body.calculator-page .container {
        max-width: 100%;
    }
    
    .wealth365-main {
        padding: 24px 40px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr 380px;
        gap: 28px;
        width: 100%;
    }
    
    .dashboard-main-chart {
        height: 480px;
    }
    
    body.calculator-page header {
        padding: 20px 60px;
    }
    
    body.calculator-page header img {
        max-width: 220px;
    }
    
    body.calculator-page main {
        grid-template-columns: 520px 1fr;
    }
    
    body.calculator-page .form-section {
        padding: 35px 40px;
    }
    
    body.calculator-page .results-section {
        padding: 40px 60px;
    }
    
    body.calculator-page .accordion-item {
        border-radius: 10px;
        margin-bottom: 12px;
    }
    
    body.calculator-page .accordion-header {
        padding: 18px 20px;
    }
    
    body.calculator-page .accordion-header h3 {
        font-size: 1rem;
    }
    
    body.calculator-page .result-cards {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 28px;
    }
    
    body.calculator-page .result-card {
        padding: 26px;
        border-radius: 12px;
    }
    
    body.calculator-page .card-label {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }
    
    body.calculator-page .card-value {
        font-size: 1.75rem;
    }
    
    body.calculator-page .tab-button {
        padding: 14px 30px;
        font-size: 1rem;
    }
    
    body.calculator-page .chart-container {
        min-height: 550px;
    }
    
    body.calculator-page #savings-chart {
        height: 520px;
    }
    
    body.calculator-page .info-box {
        padding: 20px;
        font-size: 0.95rem;
    }
    
    body.calculator-page .form-group label {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }
    
    body.calculator-page .form-group input,
    body.calculator-page .form-group select {
        padding: 13px 16px;
        font-size: 1rem;
        border-radius: 8px;
    }
    
    body.calculator-page button[type="submit"],
    body.calculator-page .btn-calculate {
        padding: 16px 32px;
        font-size: 1.05rem;
    }
    
    body.calculator-page .timeline-table th,
    body.calculator-page .timeline-table td {
        padding: 14px 18px;
        font-size: 0.95rem;
    }
    
    body.calculator-page .scenarios-grid {
        gap: 24px;
    }
    
    body.calculator-page .scenario-card {
        padding: 26px;
    }
}

/* Two-column form layout for wide screens */
@media (min-width: 1400px) {
    .form-row {
        gap: 20px;
    }
    
    .accordion-content {
        padding: 20px;
    }
    
    .checkbox-group {
        padding: 14px;
    }
}

/* ========================================
   WEALTH365-STYLE LAYOUT
   Professional financial planning interface
   ======================================== */

.wealth365-layout {
    background: #f5f7fa;
}

.wealth365-layout .wealth365-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
}

.wealth365-layout .wealth365-main {
    flex: 1;
    padding: 20px 24px;
    display: block;
    max-width: none;
    width: 100%;
}

.wealth365-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
}

.wealth365-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 12px 30px;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.header-left .wealth365-logo {
    max-height: 70px;
    max-width: 280px;
    width: auto;
    object-fit: contain;
}

.header-center {
    display: flex;
    gap: 6px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.view-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 90px;
}

.view-btn .tab-icon {
    font-size: 18px;
    line-height: 1;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.view-btn .tab-label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    color: #334155;
}

.view-btn:hover .tab-icon {
    opacity: 1;
    transform: scale(1.1);
}

.view-btn.active {
    background: white;
    color: var(--secondary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.view-btn.active .tab-icon {
    opacity: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-right .user-info {
    color: #475569;
    font-size: 14px;
    font-weight: 500;
}

.header-right a {
    color: #64748b;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.header-right a:hover {
    background: #f1f5f9;
    color: #334155;
}

.header-right .help-link {
    background: var(--secondary-color);
    color: white;
}

.header-right .help-link:hover {
    background: #3db9b0;
}

.header-right .admin-link {
    background: var(--primary-color);
    color: white;
}

.header-right .logout-link {
    background: #fee2e2;
    color: #dc2626;
}

.header-right .logout-link:hover {
    background: #fecaca;
}

.wealth365-main {
    flex: 1;
    padding: 20px 24px;
    display: block;
    max-width: none;
    width: 100%;
}

.wealth365-view {
    display: none;
    width: 100%;
}

.wealth365-view.active {
    display: block;
    width: 100%;
}

/* Dashboard View */
/* Dashboard Year/Age Bar */
.dashboard-year-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 10px;
    padding: 12px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
}

.year-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.year-display {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

.age-display {
    font-size: 0.9rem;
    color: #64748b;
    padding-left: 20px;
    border-left: 2px solid #e2e8f0;
}

.view-toggles {
    display: flex;
    gap: 8px;
}

.view-toggle {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.view-toggle:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.view-toggle.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.view-toggle.highlight {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: white;
}

.view-toggle.highlight:hover {
    background: #ee5a5a;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    margin-bottom: 16px;
    width: 100%;
}

/* Category Tabs */
.dashboard-category-tabs {
    display: flex;
    gap: 0;
    background: white;
    border-radius: 10px 10px 0 0;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    overflow-x: auto;
}

.category-tab {
    flex: 1;
    padding: 14px 20px;
    border: none;
    background: #f8fafc;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    border-right: 1px solid #e2e8f0;
    white-space: nowrap;
}

.category-tab:last-child {
    border-right: none;
}

.category-tab:hover {
    background: #f1f5f9;
    color: #475569;
}

.category-tab.active {
    background: var(--secondary-color);
    color: white;
}

/* Dashboard Data Table */
.dashboard-data-table {
    background: white;
    border-radius: 0 0 10px 10px;
    border: 1px solid #e2e8f0;
    margin-bottom: 14px;
    width: 100%;
    overflow-x: auto;
}

.data-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.table-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-action-btn {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 4px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.table-action-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.wealth365-data-table {
    width: 100%;
    border-collapse: collapse;
}

.wealth365-data-table th {
    padding: 12px 15px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.wealth365-data-table td {
    padding: 12px 15px;
    font-size: 13px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.wealth365-data-table tbody tr:hover {
    background: #f8fafc;
}

.wealth365-data-table .col-name {
    width: 25%;
}

.wealth365-data-table .col-category {
    width: 15%;
}

.wealth365-data-table .col-owner {
    width: 15%;
}

.wealth365-data-table .col-value {
    width: 15%;
    text-align: right;
}

.wealth365-data-table .col-change {
    width: 15%;
    text-align: right;
}

.wealth365-data-table .col-unfulfilled {
    width: 15%;
    text-align: right;
}

.wealth365-data-table td:nth-child(4),
.wealth365-data-table td:nth-child(5),
.wealth365-data-table td:nth-child(6) {
    text-align: right;
}

.wealth365-data-table .category-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.category-dot.taxes { background: var(--secondary-color); }
.category-dot.basics { background: #3b82f6; }
.category-dot.leisure { background: #ec4899; }
.category-dot.luxury { background: #22c55e; }
.category-dot.housing { background: #f59e0b; }

.wealth365-data-table tfoot td {
    padding: 12px 15px;
    font-size: 13px;
    background: #f8fafc;
}

.wealth365-data-table .total-row td {
    font-weight: 600;
    color: #1e293b;
    border-top: 2px solid #e2e8f0;
}

.wealth365-data-table .comparison-row td {
    color: #64748b;
    font-size: 12px;
}

.wealth365-data-table .empty-row td {
    text-align: center;
    color: #94a3b8;
    padding: 40px;
    font-style: italic;
}

.change-positive {
    color: #22c55e;
}

.change-negative {
    color: #ef4444;
}

/* Assets vs Debts Widget */
.assets-debts-chart {
    padding: 10px 0;
}

.bar-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.bar-label {
    width: 70px;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.bar-container {
    flex: 1;
    height: 24px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.assets-bar {
    background: #3b82f6;
}

.debts-bar {
    background: #ef4444;
}

.networth-bar {
    background: #22c55e;
}

.bar-value {
    width: 70px;
    font-size: 12px;
    color: #1e293b;
    font-weight: 600;
    text-align: right;
}

/* Dashboard Accordions */
.dashboard-accordions {
    margin-bottom: 20px;
}

.accordion-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border: none;
    background: #f8fafc;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    text-align: left;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: #f1f5f9;
}

.accordion-icon {
    color: #64748b;
}

.accordion-arrow {
    margin-left: auto;
    font-size: 10px;
    color: #94a3b8;
    transition: transform 0.2s;
}

.accordion-item.open .accordion-arrow {
    transform: rotate(180deg);
}

.accordion-content {
    display: none;
    padding: 15px 18px;
    border-top: 1px solid #e2e8f0;
}

.accordion-item.open .accordion-content {
    display: block;
}

.accordion-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.accordion-info-row:last-of-type {
    border-bottom: none;
}

.accordion-info-row span:first-child {
    color: #64748b;
    font-size: 13px;
}

.info-value {
    font-weight: 600;
    color: #1e293b;
    font-size: 13px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 13px;
    cursor: pointer;
    padding: 10px 0 0;
    text-decoration: underline;
}

.btn-link:hover {
    color: #3dbdb5;
}

/* Input with suffix/select styling */
.input-with-suffix {
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-with-suffix input {
    flex: 1;
}

.input-suffix {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.input-with-select {
    display: flex;
    gap: 8px;
}

.input-with-select input {
    flex: 2;
}

.input-with-select select {
    flex: 1;
    min-width: 100px;
}

/* Linked Debt Section Styling */
.btl-linked-debt-section {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 15px;
}

.dashboard-chart-area {
    background: white;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h2 {
    font-size: 1.25rem;
    color: #1e293b;
    font-weight: 600;
}

.chart-controls select {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.dashboard-main-chart {
    height: 400px;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.asset-widget,
.goals-widget {
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
}

.asset-widget h3,
.goals-widget h3 {
    font-size: 0.95rem;
    color: #1e293b;
    margin-bottom: 12px;
    font-weight: 600;
}

.pie-chart-container {
    height: 180px;
}

.goal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.goal-label {
    flex: 1;
    font-size: 14px;
    color: #475569;
}

.goal-progress {
    width: 100px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.goal-bar {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4, #3db9b0);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.goal-percent {
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-color);
    width: 45px;
    text-align: right;
}

/* Plan Overview Cards */
.plan-overview {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
}

.plan-overview h3 {
    font-size: 1.1rem;
    color: #1e293b;
    margin-bottom: 20px;
    font-weight: 600;
}

.overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.overview-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.overview-card:hover {
    background: #e6fffa;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.15);
}

.overview-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.overview-label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 4px;
}

.overview-value {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

/* Data Entry View */
#data-entry-view {
    display: none;
    grid-template-columns: 1fr;
    gap: 20px;
    min-height: calc(100vh - 140px);
}

#data-entry-view.active {
    display: grid;
}

.ff-landing {
    grid-column: 1 / -1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
}

.ff-landing__header {
    text-align: center;
    margin-bottom: 28px;
}

.ff-landing__title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px 0;
}

.ff-landing__subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.ff-sections-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
    align-items: start;
}

.ff-section {
    margin-bottom: 0;
}

.ff-section__head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding-left: 4px;
}

.ff-section__icon {
    font-size: 16px;
}

.ff-section__label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #475569;
}

.ff-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.ff-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
}

.ff-card:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

.ff-card__icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 8px;
}

.ff-card__body {
    flex: 1;
    min-width: 0;
}

.ff-card__name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2px;
}

.ff-card__desc {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.3;
}

.ff-card__status {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: transparent;
    transition: all 0.2s ease;
}

.ff-card__status.has-data {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.ff-panel-view {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    min-height: calc(100vh - 200px);
}

.ff-panel-view__sidebar {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 12px 8px;
    height: fit-content;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.ff-sidebar__heading {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    padding: 10px 10px 4px 10px;
}

.ff-sidebar__section:first-child .ff-sidebar__heading {
    padding-top: 4px;
}

.ff-sidebar__item {
    display: block;
    width: 100%;
    padding: 7px 10px;
    border: none;
    background: none;
    text-align: left;
    font-size: 12px;
    color: #475569;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ff-sidebar__item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.ff-sidebar__item.active {
    background: var(--secondary-color);
    color: white;
}

.panel-header__left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ff-back-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    font-size: 16px;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.ff-back-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.nav-panel {
    display: none;
}

.nav-toggle-btn {
    display: none;
}

.nav-section {
    margin-bottom: 25px;
}

.nav-section:last-child {
    margin-bottom: 0;
}

.nav-section h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 4px;
    font-weight: 600;
}

.nav-section-desc {
    font-size: 11px;
    color: #94a3b8;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: #e6fffa;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.nav-item.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

/* Navigation Groups */
.nav-group {
    margin-bottom: 8px;
}

.nav-group-header .nav-icon {
    font-size: 16px;
}

.nav-group-items {
    padding-left: 12px;
    border-left: 2px solid #334155;
    margin-left: 20px;
}

.nav-sub-item {
    padding: 8px 12px !important;
    font-size: 13px !important;
}

.nav-sub-item .nav-icon {
    font-size: 14px !important;
}

.nav-sub-item .nav-label {
    font-size: 12px !important;
}


.nav-item.active .nav-icon,
.nav-item.active .nav-label {
    color: white;
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.nav-label {
    font-size: 11px;
    color: #475569;
    text-align: center;
    font-weight: 500;
}

.nav-item.full-width {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px 16px;
    width: 100%;
}

.nav-item.full-width .nav-icon {
    margin-bottom: 0;
    font-size: 1.3rem;
}

.nav-item.full-width .nav-label {
    font-size: 13px;
}

.data-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
}

.panel-sticky-save {
    position: sticky;
    bottom: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}

.panel-sticky-save .panel-save-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
}

.panel-sticky-save .panel-save-status .save-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    flex-shrink: 0;
}

.panel-sticky-save .panel-save-status.saved .save-dot {
    background: #22c55e;
}

.panel-sticky-save .panel-save-status.saving .save-dot {
    background: #f59e0b;
    animation: pulse-dot 1s infinite;
}

.panel-sticky-save .panel-save-status.unsaved .save-dot {
    background: #f59e0b;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.panel-sticky-save .btn-panel-save {
    padding: 8px 20px;
    background: #3db9b0;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.panel-sticky-save .btn-panel-save:hover {
    background: #2d9a92;
}

.panel-sticky-save .btn-panel-save:disabled {
    background: #94a3b8;
    cursor: default;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.panel-header h3 {
    font-size: 1.1rem;
    color: #1e293b;
    font-weight: 600;
}

.panel-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    color: #64748b;
    transition: all 0.2s;
}

.panel-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

.panel-content {
    flex: 1;
    padding: 25px;
    min-height: 0;
}

.panel-placeholder {
    color: #94a3b8;
    text-align: center;
    padding: 60px 20px;
    font-size: 15px;
}

/* Let's See View */
#lets-see-view {
    display: none;
}

#lets-see-view.active {
    display: block;
}

.presentation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.presentation-header h2 {
    font-size: 1.5rem;
    color: #1e293b;
    font-weight: 600;
}

.presentation-controls {
    display: flex;
    gap: 10px;
}

.pres-btn {
    padding: 10px 20px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.pres-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.pres-btn.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.compare-btn {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.compare-btn:hover {
    background: #1e3a5f;
}

.presentation-chart {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
    min-height: 500px;
    margin-bottom: 25px;
}

.presentation-timeline {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
}

.timeline-bar {
    position: relative;
    height: 60px;
    background: linear-gradient(90deg, #4ecdc4 0%, #3db9b0 50%, #0d1b2a 100%);
    border-radius: 30px;
    margin: 20px 40px;
}

.marker-age {
    background: white;
    border: 3px solid #4ecdc4;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.timeline-marker.retirement .marker-age {
    border-color: #f6ad55;
    background: #fefcbf;
}

.timeline-marker.end .marker-age {
    border-color: var(--primary-color);
}

.marker-label {
    position: absolute;
    top: 60px;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
}

/* Add item button */
.add-item-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--secondary-color);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(78, 205, 196, 0.4);
    transition: all 0.2s ease;
    z-index: 100;
}

.add-item-btn:hover {
    background: #3db9b0;
    transform: scale(1.1);
}

/* Responsive adjustments for Wealth365 layout */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-sidebar {
        flex-direction: row;
    }
    
    .asset-widget,
    .goals-widget {
        flex: 1;
    }
    
    #data-entry-view {
        grid-template-columns: 1fr;
    }
}

/* Small tablets (768-900px) */
@media (max-width: 900px) and (min-width: 769px) {
    .wealth365-header {
        padding: 12px 16px;
    }
    
    .ff-panel-view {
        grid-template-columns: 160px 1fr;
        gap: 12px;
    }
    
    .ff-sidebar__item {
        font-size: 11px;
        padding: 6px 8px;
    }
    
    .dashboard-sidebar {
        flex-direction: column;
    }
}

/* Phones only (<768px) - Single column with horizontal nav */
@media (max-width: 768px) {
    .wealth365-header {
        flex-wrap: wrap;
        padding: 10px 16px;
        gap: 0;
    }
    
    #data-entry-view {
        grid-template-columns: 1fr;
    }
    
    .ff-panel-view {
        grid-template-columns: 1fr;
    }
    
    .ff-panel-view__sidebar {
        display: none;
    }
    
    .ff-sections-grid {
        grid-template-columns: 1fr;
    }

    .ff-cards {
        grid-template-columns: 1fr;
    }
    
    .ff-landing {
        padding: 0 8px;
    }
    
    .dashboard-sidebar {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .view-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .overview-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-right {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .header-right .user-info {
        width: 100%;
        text-align: center;
    }
}

/* Panel form styles */
.panel-form h4 {
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 15px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.panel-guidance {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-left: 4px solid #0ea5e9;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.panel-guidance p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #334155;
}

.btn-add-item {
    display: block;
    width: 100%;
    padding: 12px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    color: #3db9b0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 12px;
}

.btn-add-item:hover {
    background: #f0fdfa;
    border-color: #3db9b0;
}

.panel-form .form-group {
    margin-bottom: 18px;
}

.panel-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
}

.panel-form .form-group input,
.panel-form .form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
}

.panel-form .form-group input:focus,
.panel-form .form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.15);
}

.panel-form .form-group small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #94a3b8;
}

.panel-form .form-row {
    display: flex;
    gap: 15px;
}

.panel-form .form-group.half {
    flex: 1;
}

.panel-form .form-group.third {
    flex: 1;
    min-width: 80px;
}

.networth-summary {
    margin-top: 20px;
}

.networth-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.networth-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.networth-section h5 {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.networth-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.networth-row.total {
    font-weight: 600;
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
    padding-top: 12px;
}

.networth-row.grand-total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary-color);
    padding: 16px 0;
}

.nw-value {
    font-weight: 500;
    color: #1e293b;
}

.panel-form .checkbox-group {
    background: #f8fafc;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 18px;
}

.panel-form .checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
}

.panel-form .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--secondary-color);
}

.btn-save {
    width: 100%;
    padding: 12px 20px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 20px;
}

.btn-save:hover {
    background: #3db9b0;
}

.form-actions .btn-primary {
    padding: 8px 20px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.form-actions .btn-primary:hover {
    background: #3db9b0;
    transform: none;
    box-shadow: none;
}

/* Events and stages lists */
.events-list,
.stages-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-icon {
    font-size: 1.3rem;
}

.event-name {
    flex: 1;
    font-weight: 500;
    color: #1e293b;
}

.event-age {
    font-size: 13px;
    color: #64748b;
    background: #e2e8f0;
    padding: 4px 10px;
    border-radius: 12px;
}

.stage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 18px;
    border-radius: 8px;
    border-left: 4px solid;
}

.stage-item.working {
    background: #e6fffa;
    border-color: var(--secondary-color);
}

.stage-item.retired {
    background: #fef3c7;
    border-color: #f6ad55;
}

.stage-name {
    font-weight: 600;
    color: #1e293b;
}

.stage-years {
    font-size: 13px;
    color: #64748b;
}

/* Dashboard actions */
.btn-calculate-main {
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.35);
}

.btn-calculate-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.45);
}

.btn-calculate-main:active {
    transform: translateY(0);
}

/* Header enhancements */
.client-name {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

/* Timeline View Styles */
#timeline-view {
    display: none;
    position: relative;
}

#timeline-view.active {
    display: block;
}

.timeline-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.timeline-controls select {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.btn-toggle.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.timeline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.timeline-legend label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
}

.timeline-legend input[type="checkbox"] {
    accent-color: var(--secondary-color);
}

.btn-hide-all {
    padding: 6px 14px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    margin-left: auto;
}

.btn-hide-all:hover {
    background: #e2e8f0;
}

.timeline-phases {
    display: flex;
    justify-content: space-around;
    margin-bottom: 25px;
    background: linear-gradient(90deg, #4ecdc4 0%, #3db9b0 35%, #f6ad55 65%, #0d1b2a 100%);
    padding: 12px 20px;
    border-radius: 8px;
}

.timeline-phases .phase {
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Accordion Panels */
.timeline-accordion {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 25px;
}

.accordion-panel-header .panel-icon {
    font-size: 1.4rem;
}

.accordion-panel-header .panel-title {
    flex: 1;
    font-weight: 600;
    color: #1e293b;
    font-size: 15px;
}

.accordion-panel-header .panel-value {
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 15px;
}

.accordion-panel-header .panel-count {
    background: var(--secondary-color);
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.accordion-panel-header .panel-badges {
    display: flex;
    gap: 4px;
}

.person-badge {
    font-size: 1.2rem;
    color: var(--secondary-color);
}

.accordion-arrow {
    color: #94a3b8;
    font-size: 12px;
    transition: transform 0.2s;
}

.accordion-panel.open .accordion-arrow {
    transform: rotate(180deg);
}

.accordion-panel.open .accordion-panel-content {
    display: block;
}

/* Wealth365-style Age Timeline */
.wealth365-age-timeline {
    margin: 20px 0;
    position: relative;
}

.life-phase-band {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    position: absolute;
}

.life-phase-band.working {
    background: #94a3b8;
}

.life-phase-band.winding {
    background: #fbbf24;
}

.life-phase-band.living {
    background: var(--secondary-color);
}

.life-phase-band.later {
    background: #a78bfa;
}

.age-markers {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 11px;
    color: #64748b;
}

.event-markers {
    position: relative;
    margin-top: 15px;
    min-height: 80px;
    padding: 10px 0;
}

.event-marker {
    position: absolute;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s ease;
}

.event-marker:hover {
    transform: translateX(-50%) scale(1.1);
    z-index: 20;
}

.event-marker-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: 2px solid white;
}

.event-marker-icon {
    font-size: 14px;
}

.event-marker-label {
    font-size: 10px;
    font-weight: 600;
    color: #1e3a5f;
    margin-top: 4px;
    max-width: 60px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-marker-age {
    font-size: 9px;
    color: #64748b;
}

.age-markers {
    position: relative;
    height: 20px;
    margin-top: 5px;
}

.age-marker {
    position: absolute;
    transform: translateX(-50%);
    font-size: 10px;
    color: #94a3b8;
    font-weight: 500;
}

/* Goals and Events Side-by-Side Panels */
.panel-icon-small {
    font-size: 1.2rem;
}

.panel-title-small {
    font-weight: 600;
    color: #1e293b;
    flex: 1;
}

.goals-table,
.events-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.goals-table th,
.events-table th {
    text-align: left;
    padding: 8px 10px;
    color: #64748b;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    border-bottom: 1px solid #e2e8f0;
}

.goals-table td,
.events-table td {
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.progress-bar-mini {
    width: 80px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-mini .progress-fill,
.progress-fill-mini {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4, #3db9b0);
    border-radius: 4px;
}

.event-icon-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.goal-name-cell,
.event-name-cell {
    font-weight: 500;
    color: #1e293b;
}

.amount-cell {
    font-weight: 600;
    color: #059669;
    text-align: right;
}

.owner-cell,
.year-cell {
    color: #64748b;
    font-size: 12px;
}

.year-cell {
    font-weight: 600;
    color: #334155;
}

.actions-cell {
    text-align: right;
    white-space: nowrap;
}

.btn-icon-small {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    font-size: 14px;
    color: #94a3b8;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon-small:hover {
    background: #f1f5f9;
    color: #475569;
}

.goals-table tr:hover,
.events-table tr:hover {
    background: #f8fafc;
}

.goals-table tr:hover .btn-icon-small,
.events-table tr:hover .btn-icon-small {
    color: #64748b;
}

.btn-add-goal,
.btn-add-goal:hover,
@media (max-width: 768px) {
}

/* Client Creation Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-dialog {
    background: white;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.btn-cancel {
    background: transparent;
    border: none;
    color: #64748b;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
}

.btn-cancel:hover {
    color: #1e293b;
}

.btn-done {
    background: #84cc16;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.btn-done:hover {
    background: #65a30d;
}

.modal-body {
    padding: 25px;
    max-height: 70vh;
    overflow-y: auto;
}

.form-note {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 20px;
}

.modal-form-group {
    margin-bottom: 18px;
}

.modal-form-group label {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
}

.modal-form-group input,
.modal-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 14px;
    color: #1e293b;
    background: white;
}

.modal-form-group input:focus,
.modal-form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.date-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    gap: 10px;
}

.date-inputs input {
    text-align: center;
}

.person-icon-indicator {
    display: flex;
    justify-content: center;
    padding: 15px 0;
}

.person-icon-indicator span {
    font-size: 2.5rem;
    color: var(--secondary-color);
}

/* People List in Modal */
.modal-people-list {
    border-top: 1px solid #e2e8f0;
    padding: 20px;
    background: #f8fafc;
}

.people-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.people-list-header h4 {
    font-size: 14px;
    color: #1e293b;
    font-weight: 600;
}

.btn-add-person {
    background: transparent;
    border: 1px dashed #4ecdc4;
    color: var(--secondary-color);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-person:hover {
    background: rgba(78, 205, 196, 0.1);
}

.people-list-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.person-list-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    gap: 12px;
}

.person-list-item.primary {
    border-color: var(--secondary-color);
    background: rgba(78, 205, 196, 0.05);
}

.person-list-item .person-icon {
    font-size: 1.4rem;
    color: #64748b;
}

.person-list-item.primary .person-icon {
    color: var(--secondary-color);
}

.person-list-item .person-info {
    flex: 1;
}

.person-list-item .person-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 13px;
}

.person-list-item .person-type {
    font-size: 11px;
    color: #64748b;
}

.person-list-item .person-age {
    font-size: 12px;
    color: #64748b;
}

.person-list-item .person-actions {
    display: flex;
    gap: 6px;
}

.person-list-item .btn-edit-person,
.person-list-item .btn-remove-person {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
}

.person-list-item .btn-edit-person:hover {
    color: var(--secondary-color);
}

.person-list-item .btn-remove-person:hover {
    color: #ef4444;
}

/* Asset Allocation Sidebar in Timeline */
.asset-pie-chart {
    height: 200px;
}

/* Floating Action Button */
/* Insights View */
#insights-view {
    display: none;
}

#insights-view.active {
    display: block;
}

.insight-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
    width: 100%;
}

.insight-card.warning {
    border-left: 4px solid #f59e0b;
}

.insight-icon {
    font-size: 2rem;
    margin-bottom: 15px;
}

.insight-card h3 {
    font-size: 1.1rem;
    color: #1e293b;
    margin-bottom: 15px;
    font-weight: 600;
}

.gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #22c55e 100%);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.insight-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.risk-list,
.recommendations-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.risk-list li,
.recommendations-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #475569;
}

.risk-list li:last-child,
.recommendations-list li:last-child {
    border-bottom: none;
}

/* What If View */
#what-if-view {
    display: none;
}

#what-if-view.active {
    display: block;
}

.whatif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.whatif-header h2 {
    font-size: 1.5rem;
    color: #1e293b;
    font-weight: 600;
}

.scenarios-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.scenario-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 2px solid #e2e8f0;
}

.scenario-card.base {
    border-color: var(--secondary-color);
    background: linear-gradient(to bottom, #e6fffa, white);
}

.scenario-card h3 {
    font-size: 1.1rem;
    color: #1e293b;
    margin-bottom: 20px;
    font-weight: 600;
}

.scenario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.scenario-name {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
}

.scenario-adjustments {
    margin-bottom: 20px;
}

.adjustment-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.adjustment-row label {
    width: 140px;
    font-size: 14px;
    color: #475569;
}

.adjustment-row input[type="range"] {
    flex: 1;
    accent-color: var(--secondary-color);
}

.scenario-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.scenario-metric {
    text-align: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
}

.metric-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}

.metric-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

.scenario-metric.difference.positive .metric-value {
    color: #22c55e;
}

.scenario-metric.difference.negative .metric-value {
    color: #ef4444;
}

.whatif-comparison-chart {
    background: white;
    border-radius: 12px;
    padding: 25px;
    min-height: 350px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Reports View */
#reports-view {
    display: none;
}

#reports-view.active {
    display: block;
}

.reports-header {
    margin-bottom: 25px;
}

.reports-header h2 {
    font-size: 1.5rem;
    color: #1e293b;
    font-weight: 600;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.report-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.report-card:hover {
    border-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.2);
}

.report-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.report-card h3 {
    font-size: 1.1rem;
    color: #1e293b;
    margin-bottom: 10px;
    font-weight: 600;
}

.report-card p {
    font-size: 14px;
    color: #64748b;
}

.report-preview {
    background: white;
    border-radius: 12px;
    padding: 40px;
    min-height: 400px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
}

.preview-placeholder {
    text-align: center;
    color: #94a3b8;
    font-size: 16px;
}

/* Plan Settings Modal */
.settings-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s;
}

.settings-btn:hover {
    background: rgba(255,255,255,0.25);
}

.plan-settings-dialog {
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
}

.plan-settings-content {
    display: flex;
    min-height: 500px;
}

.settings-sidebar {
    width: 200px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 15px 0;
    flex-shrink: 0;
}

.settings-tab {
    display: block;
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #64748b;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.settings-tab:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.settings-tab.active {
    background: white;
    color: var(--secondary-color);
    border-left-color: var(--secondary-color);
    font-weight: 600;
}

.settings-main {
    flex: 1;
    padding: 25px 30px;
    overflow-y: auto;
    max-height: 70vh;
}

.settings-section {
    display: none;
}

.settings-section.active {
    display: block;
}

.settings-section h4 {
    font-size: 1.3rem;
    color: #1e293b;
    margin-bottom: 8px;
    font-weight: 600;
}

.settings-section .form-note {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 25px;
}

.settings-form-group {
    margin-bottom: 20px;
}

.settings-form-group label {
    display: block;
    font-size: 13px;
    color: #475569;
    margin-bottom: 5px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.settings-form-group input,
.settings-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.settings-form-group input:focus,
.settings-form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.input-with-unit {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-unit input {
    flex: 1;
    max-width: 150px;
}

.input-with-unit .unit {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.toggle-buttons {
    display: flex;
    gap: 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    width: fit-content;
}

.toggle-btn {
    padding: 8px 20px;
    border: none;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.toggle-btn:first-child {
    border-right: 1px solid #e2e8f0;
}

.toggle-btn.active {
    background: var(--secondary-color);
    color: white;
}

.toggle-btn:hover:not(.active) {
    background: #f1f5f9;
}

.allocation-total {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #1e293b;
}

.allocation-total.error {
    background: #fee2e2;
    color: #dc2626;
}

.allocation-total.success {
    background: #dcfce7;
    color: #16a34a;
}

/* Liquidation/Savings Order Lists */
.order-list {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.order-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    cursor: grab;
    transition: background 0.2s;
}

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

.order-item:hover {
    background: #f8fafc;
}

.order-item.dragging {
    opacity: 0.5;
    background: #e2e8f0;
}

.drag-handle {
    color: #94a3b8;
    margin-right: 12px;
    cursor: grab;
}

.order-number {
    width: 28px;
    height: 28px;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    margin-right: 12px;
}

.order-name {
    color: #1e293b;
    font-size: 14px;
}

.settings-info {
    margin-top: 20px;
    padding: 15px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
}

.settings-info p {
    color: #92400e;
    font-size: 13px;
    margin: 0;
}

/* Responsive Plan Settings */
@media (max-width: 768px) {
    .plan-settings-dialog {
        width: 95%;
        max-height: 90vh;
    }
    
    .plan-settings-content {
        flex-direction: column;
    }
    
    .settings-sidebar {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        padding: 10px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .settings-tab {
        flex: 1 1 auto;
        text-align: center;
        padding: 10px 12px;
        font-size: 12px;
        border-left: none;
        border-bottom: 2px solid transparent;
    }
    
    .settings-tab.active {
        border-left-color: transparent;
        border-bottom-color: var(--secondary-color);
    }
    
    .settings-main {
        padding: 20px;
        max-height: 60vh;
    }
}

/* Expense Panel Styles */
.expense-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.expense-header h4 {
    margin: 0;
}

.btn-add-expense {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add-expense:hover {
    background: #3db9b0;
}

.expense-summary {
    background: #f8fafc;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.summary-row:first-child {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 6px;
}

.expense-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.expense-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 15px;
    transition: all 0.2s;
}

.expense-item:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.15);
}

.expense-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.expense-info {
    flex: 1;
}

.expense-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
}

.expense-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.expense-actions {
    display: flex;
    gap: 6px;
}

.expense-actions button {
    background: #f1f5f9;
    border: none;
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.expense-actions button:hover {
    background: #e2e8f0;
}

/* Expense Modal Styles */
.expense-tab.active {
    background: white;
    color: var(--secondary-color);
    border-left-color: var(--secondary-color);
    font-weight: 600;
}

.expense-section {
    display: none;
}

.expense-section.active {
    display: block;
}

.expense-section h4 {
    font-size: 1.2rem;
    color: #1e293b;
    margin-bottom: 8px;
    font-weight: 600;
}

.amount-with-frequency {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.amount-with-frequency .input-with-unit {
    flex: 0 0 auto;
    min-width: 100px;
    max-width: 140px;
}

.amount-with-frequency select {
    width: 130px;
    flex-shrink: 0;
}

.amount-with-frequency > div[style*="font-size: 11px"] {
    flex-basis: 100%;
    margin-top: 0;
}

/* Priority Slider */
.expense-priority-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.expense-priority-section > label {
    display: block;
    font-size: 14px;
    color: #475569;
    margin-bottom: 10px;
    font-weight: 500;
}

.priority-slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.priority-label {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

.priority-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #10b981, #fcd34d, #f87171);
    border-radius: 3px;
    outline: none;
}

.priority-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid #4ecdc4;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.priority-categories {
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
}

.priority-cat {
    font-size: 13px;
    color: #94a3b8;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.priority-cat.active {
    background: var(--secondary-color);
    color: white;
}

/* Inflation Section */
.expense-inflation-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.expense-inflation-section > label {
    display: block;
    font-size: 14px;
    color: #475569;
    margin-bottom: 10px;
    font-weight: 500;
}

.inflation-display {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
}

.inflation-display span:first-child {
    color: #64748b;
    font-size: 14px;
}

.inflation-value {
    font-weight: 600;
    color: #1e293b;
}

.btn-edit-inline {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit-inline:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.inflation-edit {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.inflation-edit input {
    width: 80px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

/* Expense Steps */
.expense-steps-list {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 15px;
}

.step-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}

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

.step-age {
    color: #64748b;
    font-size: 14px;
}

.step-amount {
    font-weight: 500;
    color: #1e293b;
}

.btn-add-step {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}

.btn-add-step:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

/* Step Actions */
.step-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.btn-step-edit,
.btn-step-remove {
    background: transparent;
    border: 1px solid #e2e8f0;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-step-edit {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-step-edit:hover {
    background: var(--secondary-color);
    color: white;
}

.btn-step-remove {
    color: #ef4444;
    border-color: #ef4444;
}

.btn-step-remove:hover {
    background: #ef4444;
    color: white;
}

/* Step Edit Modal */
.step-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.step-edit-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.step-edit-content h4 {
    margin: 0 0 20px 0;
    color: #1e293b;
    font-size: 18px;
}

.step-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

/* Payment Sources */
.payment-order-info {
    margin-top: 20px;
    padding: 15px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
}

.payment-order-info p {
    color: #92400e;
    font-size: 13px;
    margin: 0;
}

/* Notes textarea */
.expense-section textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.expense-section textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

/* Responsive Expense Modal */
@media (max-width: 768px) {
    .expense-tab.active {
        border-left-color: transparent;
        border-bottom-color: var(--secondary-color);
    }
    
    .amount-with-frequency {
        flex-direction: column;
        align-items: stretch;
    }
    
    .amount-with-frequency select {
        width: 100%;
    }
}

/* Income Panel Styles */
.income-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.income-header h4 {
    margin: 0;
}

.btn-add-income {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add-income:hover {
    background: #3db9b0;
}

.income-summary {
    background: #f8fafc;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.income-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.income-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 15px;
    transition: all 0.2s;
}

.income-item:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.15);
}

.income-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.income-info {
    flex: 1;
}

.income-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
}

.income-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.income-actions {
    display: flex;
    gap: 6px;
}

.income-actions button {
    background: #f1f5f9;
    border: none;
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.income-actions button:hover {
    background: #e2e8f0;
}

/* Income Modal Styles */
.income-tab {
    display: block;
    width: 100%;
    padding: 12px 18px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #64748b;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.income-tab:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.income-tab.active {
    background: white;
    color: var(--secondary-color);
    border-left-color: var(--secondary-color);
    font-weight: 600;
}

.income-section {
    display: none;
}

.income-section.active {
    display: block;
}

.income-section h4 {
    font-size: 1.15rem;
    color: #1e293b;
    margin-bottom: 4px;
    font-weight: 700;
}

.income-section .form-note {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 22px;
}

.income-section h5 {
    font-size: 1rem;
    color: #475569;
    margin: 25px 0 15px 0;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

/* Inline Income Form */
.income-inline-form {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.income-inline-header {
    background: #f8fafc;
    padding: 16px 20px 0;
    border-bottom: 1px solid #e2e8f0;
}

.income-inline-header h4 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.income-inline-tabs {
    display: flex;
    gap: 0;
}

.income-inline-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}

.income-inline-tab:hover {
    color: #1e293b;
}

.income-inline-tab.active {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
    font-weight: 600;
}

.income-inline-body {
    padding: 24px 20px 8px;
}

.income-inline-section {
    display: none;
}

.income-inline-section.active {
    display: block;
}

.income-inline-form .form-actions {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.expense-inline-form {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.expense-inline-header {
    background: #f8fafc;
    padding: 16px 20px 0;
    border-bottom: 1px solid #e2e8f0;
}

.expense-inline-header h4 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.expense-inline-tabs {
    display: flex;
    gap: 0;
}

.expense-inline-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}

.expense-inline-tab:hover {
    color: #1e293b;
}

.expense-inline-tab.active {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
    font-weight: 600;
}

.expense-inline-body {
    padding: 24px 20px 8px;
}

.expense-inline-section {
    display: none;
}

.expense-inline-section.active {
    display: block;
}

.expense-inline-form .form-actions {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Growth Section */
.income-growth-section {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid #e2e8f0;
}

.income-growth-section h5 {
    margin: 0 0 12px 0;
    padding-top: 0;
    border-top: none;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.growth-display {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.growth-display span:first-child {
    color: #64748b;
    font-size: 14px;
}

.growth-value {
    font-weight: 600;
    color: #1e293b;
}

.growth-edit {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.growth-edit input {
    width: 80px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

/* Pension Section */
.income-pension-section {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid #e2e8f0;
}

.income-pension-section h5 {
    margin: 0 0 12px 0;
    padding-top: 0;
    border-top: none;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.income-pension-section .form-row {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.income-pension-section .settings-form-group.half {
    flex: 1;
}

/* Income Steps */
.income-steps-list {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 30px 20px;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 10px;
}

.empty-state p {
    color: #64748b;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Responsive Income Modal */
@media (max-width: 768px) {
    .income-tab {
        flex: 1 1 auto;
        text-align: center;
        padding: 8px 10px;
        font-size: 12px;
        border-left: none;
        border-bottom: 2px solid transparent;
    }
    
    .income-tab.active {
        border-left-color: transparent;
        border-bottom-color: var(--secondary-color);
    }
    
    .income-pension-section .form-row {
        flex-direction: column;
        gap: 10px;
    }
}

/* ========================================
   WEALTH365 ADVANCED SIMULATION STYLES
   ======================================== */

.insight-card.summary {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.insights-grid.simulations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.simulation-card .sim-icon {
    font-size: 28px;
    margin-bottom: 10px;
}

.simulation-results-panel {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-top: 30px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.simulation-results-panel .results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Simulation Modal */
.simulation-dialog {
    width: 700px;
    max-width: 95vw;
    max-height: 90vh;
    overflow: auto;
}

.simulation-modal-content {
    padding: 20px;
    background: #f8fafc;
}

.sim-form h4 {
    margin: 0 0 8px 0;
    color: var(--primary-color);
}

.sim-form .form-note {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 20px;
}

.sim-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.sim-form-grid .form-group {
    display: flex;
    flex-direction: column;
}

.sim-form-grid .form-group label {
    font-size: 13px;
    color: #475569;
    margin-bottom: 6px;
    font-weight: 500;
}

.sim-form-grid .form-group input,
.sim-form-grid .form-group select {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.sim-form-grid .form-group input:focus,
.sim-form-grid .form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.sim-modal-results {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.sim-modal-results h4 {
    margin: 0 0 16px 0;
    color: var(--primary-color);
}

.sim-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.sim-result-item {
    display: flex;
    flex-direction: column;
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.sim-result-item .label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.sim-result-item .value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

.sim-result-item.highlight {
    background: #e0f7f5;
    border-color: var(--secondary-color);
}

.sim-result-item.highlight .value {
    color: #0d9488;
}

.sim-result-item.error {
    background: #fef2f2;
    border-color: #fca5a5;
}

.sim-result-item.error .value {
    color: #dc2626;
}

.sim-result-full {
    grid-column: 1 / -1;
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.sim-result-full ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.sim-result-full li {
    font-size: 13px;
    color: #475569;
    margin-bottom: 4px;
}

.status-success {
    color: #059669;
    font-weight: 600;
}

.status-danger {
    color: #dc2626;
    font-weight: 600;
}

.status-warning {
    color: #d97706;
    font-weight: 600;
}

#sim-modal-results-chart {
    margin-top: 20px;
    min-height: 300px;
}

/* Modal Primary Button */
.modal-actions .btn-primary {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.modal-actions .btn-primary:hover {
    background: #38b2ac;
}

@media (max-width: 600px) {
    .simulation-dialog {
        width: 100%;
        max-height: 95vh;
    }
    
    .sim-form-grid {
        grid-template-columns: 1fr;
    }
    
    .sim-results-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Compare Plans Styles */
.compare-plans-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.compare-plan {
    flex: 1;
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    border: 2px solid #e2e8f0;
}

.compare-plan.plan-a {
    border-color: var(--secondary-color);
}

.compare-plan.plan-b {
    border-color: #45b7d1;
}

.compare-plan h5 {
    margin: 0 0 16px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.compare-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #94a3b8;
    padding: 0 10px;
}

.compare-results-grid {
    display: grid;
    grid-template-columns: 150px 1fr 1fr 80px;
    gap: 8px 12px;
    margin-bottom: 20px;
}

.compare-col {
    padding: 8px 12px;
    font-size: 14px;
    color: #475569;
}

.compare-col.header {
    font-weight: 600;
    color: #1e293b;
    background: #f1f5f9;
    border-radius: 4px;
}

.compare-col.label {
    font-weight: 500;
    color: #64748b;
}

.compare-col.winner {
    background: rgba(78, 205, 196, 0.15);
    color: #0d9488;
    font-weight: 600;
    border-radius: 4px;
}

.compare-col.winner-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-color);
    color: white;
    font-weight: 600;
    border-radius: 4px;
}

.compare-summary {
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
}

.compare-summary p {
    margin: 8px 0;
    font-size: 14px;
    color: #475569;
}

/* Plan Insights Styles */
.insights-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.insight-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px 20px;
    border-left: 4px solid #94a3b8;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.insight-card.high {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.insight-card.medium {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.insight-card.low {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.insight-card.success {
    border-left-color: #22c55e;
    background: #f0fdf4;
}

.insight-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.insight-content {
    flex: 1;
}

.insight-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.insight-message {
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}

.insight-action {
    font-size: 13px;
    color: var(--secondary-color);
    margin-top: 8px;
    font-weight: 500;
}

/* Asset Allocation Pie Chart Styles */
/* Legacy Flow Diagram Styles */
.legacy-flow-container {
    background: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
}

.legacy-person-section {
    margin-bottom: 32px;
}

.legacy-person-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.legacy-person-icon {
    width: 32px;
    height: 32px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.legacy-person-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 16px;
}

.legacy-person-value {
    color: var(--secondary-color);
    font-weight: 600;
}

.legacy-person-meta {
    font-size: 13px;
    color: #64748b;
}

.legacy-flow-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.legacy-box {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 120px;
    text-align: center;
}

.legacy-box.estate {
    border-color: var(--secondary-color);
    border-width: 2px;
}

.legacy-box.beneficiary {
    border-color: #45b7d1;
}

.legacy-box.tax {
    border-color: #ef4444;
    background: #fef2f2;
}

.legacy-box-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.legacy-box-value {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.legacy-arrow {
    color: #94a3b8;
    font-size: 20px;
}

.legacy-tax-row.total {
    font-weight: 600;
    color: #1e293b;
    border-top: 2px solid #e2e8f0;
    margin-top: 8px;
    padding-top: 12px;
}

.legacy-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid #e2e8f0;
}

.legacy-summary-item {
    text-align: center;
}

.legacy-summary-label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 4px;
}

.legacy-summary-value {
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
}

.legacy-summary-value.tax {
    color: #ef4444;
}

/* Save the Surplus Styles */
.surplus-allocation {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.surplus-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.surplus-amount {
    font-size: 24px;
    font-weight: 600;
    color: var(--secondary-color);
}

.surplus-bar-container {
    display: flex;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.surplus-bar-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 500;
}

.surplus-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.surplus-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.surplus-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .compare-plans-container {
        flex-direction: column;
    }
    
    .compare-vs {
        transform: rotate(90deg);
        padding: 10px 0;
    }
    
    .compare-results-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .legacy-flow-row {
        flex-wrap: wrap;
    }
}

/* Household Context Styles */
.household-context {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.member-selector {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color, #ccc);
    background: white;
    font-size: 0.85rem;
    min-width: 150px;
}

.btn-invite-member {
    background: var(--accent-teal, #00b8a9);
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    transition: background-color 0.2s;
}

.btn-invite-member:hover {
    background: var(--accent-teal-dark, #009688);
}

/* Modal Overlay Styles (shared) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-dialog {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    background: var(--primary-navy, #1a237e);
    color: white;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-form-group {
    margin-bottom: 1rem;
}

.modal-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.modal-form-group input,
.modal-form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-done {
    background: var(--accent-teal, #00b8a9);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-done:hover {
    background: var(--accent-teal-dark, #009688);
}

/* Tab Settings Button */
.tab-settings-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px 12px;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.tab-settings-btn:hover {
    opacity: 1;
}

/* Tab Settings Modal */
.tab-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}
.tab-settings-modal.active {
    display: flex;
}
.tab-settings-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    min-width: 320px;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.tab-settings-content h3 {
    margin: 0 0 16px 0;
    color: var(--primary-color);
}
.tab-toggle-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}
.tab-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}
.tab-toggle-item:last-child {
    border-bottom: none;
}
.tab-toggle-item label {
    font-size: 0.95rem;
    color: var(--text-primary);
}
.tab-settings-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.tab-settings-actions button {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}
.tab-settings-actions .save-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
}
.tab-settings-actions .cancel-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* Drilldown Modal */
.drilldown-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}
.drilldown-modal.active {
    display: flex;
}
.drilldown-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.drilldown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--primary-color);
    color: white;
    border-radius: 12px 12px 0 0;
}
.drilldown-header h3 {
    margin: 0;
    font-size: 1.1rem;
}
.drilldown-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.drilldown-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}
.drilldown-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}
.drilldown-hint {
    font-size: 0.8rem;
    color: #64748b;
}
.drilldown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.drilldown-table th,
.drilldown-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
.drilldown-table th {
    background: #f1f5f9;
    font-weight: 600;
    color: var(--primary-color);
}
.drilldown-table tr:hover {
    background: #f8fafc;
}
.drilldown-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.drilldown-stat {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}
.drilldown-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}
.drilldown-stat-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 4px;
}

/* Clickable bar rows for drilldown */
.bar-row.clickable-bar {
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    padding: 5px;
    border-radius: 5px;
    margin: -5px;
    margin-bottom: 7px;
}

.bar-row.clickable-bar:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

/* ================================
   NEW DASHBOARD 80/20 LAYOUT
   ================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: 80% 20%;
    gap: 20px;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.dashboard-side {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Section containers */
.dashboard-section {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.dashboard-section-header {
    background: linear-gradient(135deg, #1e3a5f, #2c5282);
    color: white;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-section-header .section-icon {
    font-size: 1.3rem;
}

.dashboard-section-content {
    padding: 20px;
}

/* Charts container */
.chart-container {
    min-height: 350px;
    margin-bottom: 20px;
}

/* Data tables */
.dashboard-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.dashboard-data-table thead th {
    background: #f1f5f9;
    color: #1e3a5f;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
}

.dashboard-data-table tbody tr {
    cursor: pointer;
    transition: all 0.2s ease;
}

.dashboard-data-table tbody tr:hover {
    background: #f0f9ff;
    transform: translateX(5px);
}

.dashboard-data-table tbody tr:active {
    background: #dbeafe;
}

.dashboard-data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.dashboard-data-table .row-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-data-table .row-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.dashboard-data-table .row-icon.income { background: #dcfce7; color: #16a34a; }
.dashboard-data-table .row-icon.expense { background: #fee2e2; color: #dc2626; }
.dashboard-data-table .row-icon.asset { background: #dbeafe; color: #2563eb; }
.dashboard-data-table .row-icon.liability { background: #fef3c7; color: #d97706; }
.dashboard-data-table .row-icon.neutral { background: #f1f5f9; color: #64748b; }

.dashboard-data-table .amount {
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.dashboard-data-table .amount.positive { color: #16a34a; }
.dashboard-data-table .amount.negative { color: #dc2626; }

.dashboard-data-table .edit-indicator {
    opacity: 0;
    color: #3b82f6;
    font-size: 1rem;
    transition: opacity 0.2s ease;
}

.dashboard-data-table tbody tr:hover .edit-indicator {
    opacity: 1;
}

/* Table category headers */
.dashboard-data-table .category-row {
    background: #f8fafc;
    cursor: default;
}

.dashboard-data-table .category-row:hover {
    background: #f8fafc;
    transform: none;
}

.dashboard-data-table .category-row td {
    font-weight: 700;
    color: #1e3a5f;
    padding: 10px 15px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Total rows */
.dashboard-data-table .total-row {
    background: #1e3a5f;
    color: white;
    cursor: default;
}

.dashboard-data-table .total-row:hover {
    background: #1e3a5f;
    transform: none;
}

.dashboard-data-table .total-row td {
    font-weight: 700;
    padding: 14px 15px;
}

/* Scrollable table container */
.table-scroll-container {
    max-height: 400px;
    overflow-y: auto;
}

/* Side column cards */
.side-card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #e2e8f0;
}

.side-card:hover {
    background: #f0f9ff;
    transform: translateX(5px);
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.side-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.side-card-icon.family { background: #fce7f3; color: #db2777; }
.side-card-icon.goals { background: #fef3c7; color: #d97706; }
.side-card-icon.estate { background: #e0e7ff; color: #6366f1; }
.side-card-icon.transfers { background: #d1fae5; color: #059669; }
.side-card-icon.kyc { background: #fee2e2; color: #dc2626; }
.side-card-icon.settings { background: #f1f5f9; color: #64748b; }

.side-card-content {
    flex: 1;
    min-width: 0;
}

.side-card-title {
    font-weight: 600;
    color: #1e3a5f;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.side-card-subtitle {
    color: #64748b;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.side-card-arrow {
    color: #94a3b8;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.side-card:hover .side-card-arrow {
    transform: translateX(3px);
    color: #3b82f6;
}

/* Responsive: stack on mobile */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-side {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .side-card {
        flex: 1 1 calc(50% - 10px);
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        padding: 10px;
    }
    
    .side-card {
        flex: 1 1 100%;
    }
    
    .chart-container {
        min-height: 250px;
    }
    
    .dashboard-data-table {
        font-size: 0.85rem;
    }
    
    .dashboard-data-table td,
    .dashboard-data-table th {
        padding: 8px 10px;
    }
}

/* Edit indicator animation */
@keyframes highlight-pulse {
    0% { background-color: #fef3c7; }
    100% { background-color: transparent; }
}

/* Ensure new dashboard shows above legacy content */
.dashboard-grid {
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 30px;
}

/* Side column sticky on desktop */
@media (min-width: 1200px) {
    .dashboard-side {
        position: sticky;
        top: 20px;
        align-self: start;
    }
}

/* Generate Report Card Styling */
.generate-report-card {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    border: none;
}

.generate-report-card:hover {
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
    transform: translateX(5px);
}

.generate-report-card .side-card-title {
    color: white;
}

.generate-report-card .side-card-subtitle {
    color: rgba(255, 255, 255, 0.8);
}

.generate-report-card .side-card-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.generate-report-card .side-card-arrow {
    color: white;
}

/* Placeholder row styling */
.placeholder-row td {
    background: #f8fafc;
    font-style: italic;
}

/* Plan Progress Card Styling */
.progress-card {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
    border: 1px solid rgba(20, 184, 166, 0.3);
}

.progress-card:hover {
    transform: none;
    cursor: default;
}

.progress-card .side-card-icon {
    background: rgba(20, 184, 166, 0.2);
    color: #14b8a6;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 8px 0 6px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #14b8a6 0%, #0d9488 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-stats {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

/* Section completion indicators */
.side-card.section-complete .side-card-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.side-card.section-complete::after {
    content: '✓';
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    color: #22c55e;
    font-size: 14px;
    font-weight: bold;
}

.side-card {
    position: relative;
}

/* Progress Checklist Styling */
.progress-checklist {
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.checklist-item.complete {
    color: #22c55e;
}

.checklist-item.pending {
    color: rgba(255, 255, 255, 0.5);
}

.checklist-item .check-icon {
    font-size: 14px;
    width: 16px;
}

.checklist-empty {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    padding: 4px 0;
}

.progress-card .side-card-content {
    flex: 1;
}

/* Main Dashboard Progress Widget */
.plan-progress-widget {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(20, 184, 166, 0.3);
}

.progress-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.progress-icon {
    font-size: 20px;
}

.progress-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    flex: 1;
}

.progress-percent {
    font-size: 18px;
    font-weight: 700;
    color: #14b8a6;
}

.progress-bar-main {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #14b8a6 0%, #0d9488 100%);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.progress-checklist-main {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.progress-checklist-main .checklist-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 4px 0;
}

.progress-checklist-main .checklist-item.complete {
    color: #22c55e;
}

.progress-checklist-main .checklist-item.pending {
    color: rgba(255, 255, 255, 0.5);
}

.progress-checklist-main .checklist-empty {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    font-size: 13px;
}

/* ================================
   HIDE LEGACY DASHBOARD ELEMENTS
   ================================ */

/* Hide legacy category tabs */
.dashboard-category-tabs {
    display: none !important;
}

/* Hide legacy data table in dashboard (outside of dashboard-section) */
div.dashboard-data-table {
    display: none !important;
}

/* But show tables inside dashboard sections */
.dashboard-section table.dashboard-data-table {
    display: table !important;
}

/* Hide legacy Plan Overview section */
.plan-overview {
    display: none !important;
}

/* Hide the progress widget added to wrong location */
.plan-progress-widget {
    display: none !important;
}

/* Ensure 80/20 layout is visible */
#dashboard-grid-main {
    display: grid !important;
}


/* ==========================================
   FACT FIND PAGE IMPROVEMENTS
   ========================================== */

/* Compact Data Entry Progress Section */
.ff-progress-bar {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 16px;
    margin-top: 8px;
    border: 1px solid #e2e8f0;
}

.ff-progress-bar__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ff-progress-bar__title {
    font-size: 13px;
    font-weight: 600;
    color: #1e3a5f;
}

.ff-progress-bar__pct {
    font-size: 13px;
    font-weight: 700;
    color: #2dd4bf;
}

.ff-progress-bar__track {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.ff-progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, #2dd4bf 0%, #14b8a6 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.ff-progress-bar__summary {
    font-size: 11px;
    color: #64748b;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ff-progress-bar__summary span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ff-progress-bar__summary .done {
    color: #059669;
}

.ff-progress-bar__summary .todo {
    color: #94a3b8;
}

/* Tighter journey-nav on Fact Find */
#data-entry-view .journey-nav {
    padding: 12px 16px;
    margin-bottom: 8px;
}

#data-entry-view .journey-nav__step {
    font-size: 14px;
}

#data-entry-view .journey-nav__subtitle {
    font-size: 11px;
}

/* Legacy nav-panel collapse - no longer used */


/* Fix data-entry-view grid layout - progress bar should span both columns */
.ff-progress-bar {
    grid-column: 1 / -1;
}

/* ================================
   ENHANCED ROUNDED CORNERS
   Modern UI with consistent rounded edges
   ================================ */

/* Main panel containers */
.data-panel,
.panel-form,
.side-panel,
.overview-card,
.summary-card,
.dashboard-section,
.holding-card,
.family-card,
.income-card,
.expense-card,
/* Cards and smaller elements */
.nav-item,
.tab-btn,
.btn-save,
.btn-cancel,
.btn-add-family,
.view-btn,
.status-badge {
    border-radius: var(--radius-md) !important;
}

/* Form inputs and selects */
.panel-form input[type="text"],
.panel-form input[type="number"],
.panel-form input[type="email"],
.panel-form input[type="password"],
.panel-form input[type="date"],
.panel-form select,
.panel-form textarea,
.form-control {
    border-radius: var(--radius-sm) !important;
}

/* Accordion sections */
.accordion-item {
    border-radius: var(--radius-md) !important;
    overflow: hidden;
}

/* Setup panel cards */
.panel-card {
    border-radius: var(--radius-lg) !important;
}

/* Summary stats boxes */
.summary-stat,
.stat-card,
.quick-stat {
    border-radius: var(--radius-md) !important;
}

/* Modal and popup containers */
.add-family-form,
.add-goal-form,
.modal-content {
    border-radius: var(--radius-lg) !important;
}

/* Auth pages - login, register */
/* Alert and info boxes */
.info-box,
.panel-alert,
.warning-box,
.success-box {
    border-radius: var(--radius-md) !important;
}

/* Header logo container */
.header-left {
    padding: 5px 0;
}

.wealth365-logo {
    border-radius: 10px;
    background: var(--primary-color);
    padding: 10px 16px;
}

/* Text-based logo styling */
.wealth365-logo-text {
    display: inline-flex;
    align-items: center;
    background: var(--primary-color);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.wealth365-logo-text .logo-retire {
    color: #ffffff;
}

.wealth365-logo-text .logo-365 {
    color: var(--secondary-color);
    margin-left: 2px;
}

/* Progress bars and indicators */
.progress-bar,
.progress-fill {
    border-radius: var(--radius-sm) !important;
}

/* Table cells with rounded corners on first/last */
.data-table tr:first-child td:first-child {
    border-top-left-radius: var(--radius-sm);
}
.data-table tr:first-child td:last-child {
    border-top-right-radius: var(--radius-sm);
}
.data-table tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius-sm);
}
.data-table tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-sm);
}

/* Toggle Switch Component */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(148, 163, 184, 0.3);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #10b981;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.toggle-switch.always-on input:checked + .toggle-slider {
    background-color: rgba(16, 185, 129, 0.4);
}

/* Panel Toggle Card */
.panel-toggle-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.panel-toggle-card:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.1);
}

.panel-toggle-card.disabled {
    opacity: 0.5;
    background: rgba(100,116,139,0.1);
}

.panel-toggle-card.always-on {
    background: rgba(16,185,129,0.1);
    cursor: default;
}

.panel-toggle-card .panel-info {
    flex: 1;
    min-width: 0;
}

.panel-toggle-card .panel-name {
    font-weight: 500;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.panel-toggle-card .panel-desc {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.panel-toggle-card .panel-badge {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Undo Toast for Panel Toggle */
.panel-undo-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #f8fafc;
    padding: 12px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    z-index: 10001;
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

.panel-undo-toast .undo-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s;
}

.panel-undo-toast .undo-btn:hover {
    background: #059669;
}

.panel-undo-toast .undo-timer {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    position: absolute;
    bottom: 0;
    left: 0;
    overflow: hidden;
}

.panel-undo-toast .undo-timer-fill {
    height: 100%;
    background: #10b981;
    animation: timerShrink 5s linear forwards;
}

@keyframes timerShrink {
    from { width: 100%; }
    to { width: 0%; }
}

/* Collapsed Panel State */
.nav-item.panel-collapsed {
    opacity: 0.4;
    position: relative;
}

.nav-item.panel-collapsed::after {
    content: "OFF";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 8px;
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Confirmation Modal Overlay */
.panel-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    animation: fadeIn 0.2s ease;
}

.panel-confirm-content {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    padding: 24px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.panel-confirm-content h4 {
    margin: 0 0 12px 0;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-confirm-content p {
    color: #94a3b8;
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.5;
}

.panel-confirm-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.panel-confirm-buttons button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.panel-confirm-buttons .cancel-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #94a3b8;
}

.panel-confirm-buttons .cancel-btn:hover {
    background: rgba(255,255,255,0.05);
    color: #f8fafc;
}

.panel-confirm-buttons .confirm-btn {
    background: #ef4444;
    border: none;
    color: white;
}

.panel-confirm-buttons .confirm-btn:hover {
    background: #dc2626;
}

/* Quick Setup Section Styles */
.persona-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.panel-chip:hover {
    opacity: 0.85;
    transform: scale(1.02);
}

.panel-chip .chip-remove:hover {
    opacity: 1;
    color: #dc2626;
}

.drawer-toggle-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Plan readiness bar animation */
#readiness-bar {
    animation: readinessPulse 2s ease-in-out infinite;
}

@keyframes readinessPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* Responsive persona cards */
@media (max-width: 768px) {
    .persona-presets {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .drawer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .persona-presets {
        grid-template-columns: 1fr !important;
    }
    
    .drawer-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ===== Header Cleanup - User Menu Dropdown ===== */
.user-menu-container {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 4px 10px 4px 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-menu-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4ecdc4, #10b981);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.user-menu-arrow {
    color: rgba(255,255,255,0.7);
    font-size: 10px;
    transition: transform 0.2s;
}

.user-menu-btn.open .user-menu-arrow {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    min-width: 200px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.user-menu-dropdown.show {
    display: block;
    animation: menuSlideDown 0.15s ease-out;
}

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

.user-menu-header {
    padding: 12px 15px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.user-menu-name {
    display: block;
    font-weight: 600;
    color: #1e3a5f;
    font-size: 14px;
}

.user-menu-role {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-menu-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #475569;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s;
}

.user-menu-item:hover {
    background: #f1f5f9;
    color: #1e3a5f;
}

.user-menu-item.logout {
    color: #dc2626;
}

.user-menu-item.logout:hover {
    background: #fef2f2;
}

/* ===== Segmented Control for View Toggles ===== */
.view-segmented-control {
    display: flex;
    background: #e2e8f0;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.view-segmented-control .segment {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.view-segmented-control .segment:hover {
    color: #1e3a5f;
    background: rgba(255,255,255,0.5);
}

.view-segmented-control .segment.active {
    background: white;
    color: #1e3a5f;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.view-segmented-control .segment-icon {
    font-size: 14px;
}

.view-segmented-control .segment-label {
    display: none;
}

@media (min-width: 768px) {
    .view-segmented-control .segment-label {
        display: inline;
    }
}

/* ===== Compact Plan Controls ===== */
.plan-controls-compact {
    display: flex;
    align-items: center;
    gap: 12px;
}

.plan-selector-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.plan-selector-slim {
    padding: 5px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    color: #1e3a5f;
    min-width: 120px;
    cursor: pointer;
}

.plan-type-badge-slim {
    background: #dbeafe;
    color: #1e40af;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.plan-type-badge-slim:hover {
    background: #bfdbfe;
}

.plan-actions-group {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 2px;
}

.plan-icon-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}

.plan-icon-btn:hover {
    background: white;
    color: #1e3a5f;
}

.plan-icon-btn.save {
    color: #10b981;
}

.plan-icon-btn.save:hover {
    background: #dcfce7;
    color: #059669;
}

.plan-icon-btn.danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

.plan-icon-btn.create-plan-highlight {
    background: #4ecdc4;
    color: #1e3a5f;
    font-weight: 700;
    font-size: 16px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: 0 0 0 2px rgba(78,205,196,0.3);
    animation: pulse-create 2s ease-in-out 3;
}
.plan-icon-btn.create-plan-highlight:hover {
    background: #3db8b0;
    color: white;
    box-shadow: 0 0 0 3px rgba(78,205,196,0.5);
}
@keyframes pulse-create {
    0%, 100% { box-shadow: 0 0 0 2px rgba(78,205,196,0.3); }
    50% { box-shadow: 0 0 0 6px rgba(78,205,196,0.15); }
}

.plan-status-pill {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
}

.plan-status-pill.saving {
    background: #fef3c7;
    color: #d97706;
}

.plan-status-pill.saved {
    background: #dcfce7;
    color: #059669;
}

.plan-status-pill.error {
    background: #fef2f2;
    color: #dc2626;
}

/* ===== Dashboard Year Bar Improvements ===== */
.dashboard-year-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    gap: 15px;
    flex-wrap: wrap;
}

.year-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-context {
    display: flex;
    align-items: center;
    gap: 10px;
}

.signed-in-user {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #1e3a5f;
}

.user-icon-small {
    font-size: 14px;
}

.user-role-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-admin {
    background: #fee2e2;
    color: #dc2626;
}

.badge-advisor {
    background: #dbeafe;
    color: #1e40af;
}

.badge-user {
    background: #f1f5f9;
    color: #64748b;
}

.client-selector {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: white;
}

.context-separator {
    color: #cbd5e1;
}

.viewing-label {
    font-size: 12px;
    color: #64748b;
}

@media (max-width: 768px) {
    .dashboard-year-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .plan-controls-compact {
        width: 100%;
        justify-content: space-between;
    }
    
    .view-segmented-control {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   Journey Navigation Header Styles
   ======================================== */
.journey-nav {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    padding: 16px 24px;
    min-height: 64px;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    grid-column: 1 / -1; /* Span all grid columns */
}

.journey-nav__rail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    max-width: 100%;
}

.journey-nav__copy {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.journey-nav__step {
    margin: 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.journey-nav__subtitle {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    line-height: 1.4;
}

.journey-nav__action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s ease;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
}

.journey-nav__action--ghost {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.journey-nav__action--ghost:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.journey-nav__action--primary {
    background: #14b8a6;
    color: white;
    border: none;
    font-weight: 600;
}

.journey-nav__action--primary:hover {
    background: #0d9488;
}

.journey-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 10px;
}

.journey-progress__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.journey-progress__dot--completed {
    background: #14b8a6;
    border-color: #14b8a6;
}

.journey-progress__dot--current {
    width: 12px;
    height: 12px;
    background: white;
    border-color: white;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.journey-progress__line {
    width: 24px;
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.journey-progress__line--completed {
    background: #14b8a6;
}

.journey-nav__next-hint {
    display: block;
    width: 100%;
    font-size: 10px;
    font-weight: 400;
    opacity: 0.75;
    margin-top: 1px;
    white-space: nowrap;
}

.view-btn .step-check {
    display: none;
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #14b8a6;
    border-radius: 50%;
    color: white;
    font-size: 9px;
    line-height: 14px;
    text-align: center;
    font-weight: 700;
}

.view-btn.step-done .step-check {
    display: block;
}

.view-btn {
    position: relative;
}

/* Responsive: stack on very small screens */
@media (max-width: 640px) {
    .journey-nav {
        padding: 12px 16px;
    }
    
    .journey-nav__rail {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .journey-nav__copy {
        order: -1;
        flex-basis: 100%;
        text-align: left;
    }
    
    .journey-nav__step {
        font-size: 16px;
    }
    
    .journey-nav__action {
        padding: 8px 14px;
        font-size: 13px;
    }

    .journey-nav__next-hint {
        display: none;
    }

    .journey-progress__line {
        width: 14px;
    }

    .journey-progress__dot {
        width: 8px;
        height: 8px;
    }

    .journey-progress__dot--current {
        width: 10px;
        height: 10px;
    }
}

/* ==========================================
   RESPONSIVE OPTIMIZATION - PC, iPad, Mobile
   ========================================== */

/* === MOBILE FIRST BASE (< 480px) === */
@media (max-width: 480px) {
    /* Navigation */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar.open + .sidebar-overlay {
        display: block;
    }
    
    /* Main content */
    .main-content {
        margin-left: 0 !important;
        padding: 10px !important;
        width: 100% !important;
    }
    
    /* Form layouts */
    .form-row, .two-column, .form-grid, .income-grid, .expense-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    /* Cards and panels */
    .panel, .card, .accordion-content, .income-section, .expense-section {
        padding: 12px !important;
        margin: 8px 0 !important;
        border-radius: 8px !important;
    }
    
    /* Buttons - touch friendly */
    button, .btn, .action-btn, input[type="submit"] {
        min-height: 44px !important;
        padding: 10px 16px !important;
        font-size: 14px !important;
    }
    
    /* Input fields - larger for touch */
    input, select, textarea {
        min-height: 44px !important;
        font-size: 16px !important;
        padding: 10px 12px !important;
    }
    
    /* Tables - horizontal scroll */
    .table-container, .data-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    /* Charts - full width */
    .chart-container, .plotly-chart {
        width: 100% !important;
        height: 250px !important;
    }
    
    /* Modal and settings panels */
    .modal-content, .settings-panel, .plan-settings-modal {
        width: 95% !important;
        max-width: none !important;
        margin: 10px auto !important;
        max-height: 85vh !important;
    }
    
    /* Dashboard cards stack */
    .dashboard-grid, .summary-cards, .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    /* Hero section */
    .hero-grid, .hero-stats {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
    
    /* Report builder */
    .report-builder-container {
        grid-template-columns: 1fr !important;
    }
    
    /* Tab navigation - scrollable */
    .tab-nav, .tab-buttons {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
    }
    
    .tab-btn, .tab-button {
        flex-shrink: 0;
    }
    
    /* Typography scaling */
    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.25rem !important; }
    h3 { font-size: 1.1rem !important; }
    
    /* Accordion headers */
    .accordion-header {
        padding: 12px !important;
    }
    
    /* Plan settings two-column to single */
    .settings-grid, .settings-two-column {
        grid-template-columns: 1fr !important;
    }
}

/* === SMALL TABLETS & LARGE PHONES (481px - 767px) === */
@media (min-width: 481px) and (max-width: 767px) {
    .main-content {
        margin-left: 0 !important;
        padding: 15px !important;
    }
    
    .form-row, .two-column {
        grid-template-columns: 1fr 1fr !important;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .chart-container {
        height: 280px !important;
    }
    
    .modal-content {
        width: 90% !important;
    }
}

/* === iPAD PORTRAIT (768px - 1023px) === */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Sidebar - collapsible on iPad */
    .sidebar {
        width: 60px;
        overflow: hidden;
        transition: width 0.3s ease;
    }
    
    .sidebar:hover, .sidebar.expanded {
        width: 220px;
    }
    
    .sidebar .nav-text {
        opacity: 0;
        transition: opacity 0.2s ease;
    }
    
    .sidebar:hover .nav-text,
    .sidebar.expanded .nav-text {
        opacity: 1;
    }
    
    /* Main content adjusts */
    .main-content {
        margin-left: 60px !important;
        padding: 20px !important;
        transition: margin-left 0.3s ease;
    }
    
    /* Two column forms */
    .form-row, .two-column {
        grid-template-columns: 1fr 1fr !important;
    }
    
    /* Dashboard - 2 columns */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    
    /* Charts */
    .chart-container {
        height: 300px !important;
    }
    
    /* Settings panels - 2 column */
    .settings-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    
    /* Report builder - stack */
    .report-builder-container {
        grid-template-columns: 1fr !important;
    }
    
    /* Modal sizing */
    .modal-content {
        width: 85% !important;
        max-width: 700px !important;
    }
    
    /* Tables */
    .table-container {
        overflow-x: auto;
    }
}

/* === iPAD LANDSCAPE (1024px - 1199px) === */
@media (min-width: 1024px) and (max-width: 1199px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px !important;
        padding: 25px !important;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .form-row {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Report builder - side by side but smaller */
    .report-builder-container {
        grid-template-columns: 300px 1fr !important;
    }
}

/* === PC STANDARD (1200px - 1599px) === */
@media (min-width: 1200px) and (max-width: 1599px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
        padding: 30px;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .form-row {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .chart-container {
        height: 350px;
    }
}

/* === PC LARGE (1600px+) === */
@media (min-width: 1600px) {
    .main-content {
        max-width: 1600px;
        margin: 0 auto;
        padding: 40px;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .form-row {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .chart-container {
        height: 400px;
    }
    
    /* Larger fonts for big screens */
    body {
        font-size: 16px;
    }
    
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
}

/* === TOUCH DEVICE OPTIMIZATIONS === */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    button, .btn, a.nav-link, .accordion-header, .tab-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch */
    button:hover, .btn:hover, .nav-link:hover {
        transform: none;
    }
    
    /* Better scrolling */
    .scrollable, .table-container, .modal-body {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Disable text selection on interactive elements */
    button, .btn, .nav-link, .accordion-header {
        -webkit-user-select: none;
        user-select: none;
    }
}

/* === LANDSCAPE PHONE OPTIMIZATION === */
@media (orientation: landscape) and (max-height: 500px) {
    .modal-content {
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .sidebar {
        width: 50px;
    }
    
    .main-content {
        margin-left: 50px !important;
    }
    
    /* Reduce vertical padding */
    .panel, .card {
        padding: 10px !important;
    }
    
    .chart-container {
        height: 200px !important;
    }
}

/* === PRINT OPTIMIZATION === */
@media print {
    .sidebar, .nav-panel, .tab-nav, button, .btn {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    .chart-container {
        page-break-inside: avoid;
    }
}

/* === ACCESSIBILITY IMPROVEMENTS === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === HIGH CONTRAST MODE === */
@media (prefers-contrast: high) {
    .panel, .card {
        border: 2px solid currentColor;
    }
    
    button, .btn {
        border: 2px solid currentColor;
    }
}

/* === MOBILE NAVIGATION ENHANCEMENTS === */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f2744 100%);
    z-index: 998;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.mobile-header__logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.mobile-header__logo span {
    color: #4ecdc4;
}

.mobile-menu-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
}

.mobile-menu-btn:hover {
    background: rgba(255,255,255,0.1);
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex !important;
    }
    
    .nav-panel {
        position: fixed !important;
        left: -300px !important;
        top: 0 !important;
        height: 100vh !important;
        width: 280px !important;
        z-index: 1001 !important;
        transition: left 0.3s ease !important;
        overflow-y: auto !important;
        padding-top: 60px !important;
    }
    
    .nav-panel.mobile-open {
        left: 0 !important;
    }
    
    .mobile-nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1000;
    }
    
    .mobile-nav-overlay.active {
        display: block;
    }
    
    /* Hide desktop nav toggle on mobile */
    .nav-toggle-btn {
        display: none !important;
    }
}

/* Ensure smooth transitions */
.nav-panel {
    transition: left 0.3s ease, width 0.3s ease;
}


/* ===== INSIGHTS DRAWER RESPONSIVE STYLES ===== */
#insights-drawer {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

#insights-drawer::-webkit-scrollbar {
    width: 6px;
}

#insights-drawer::-webkit-scrollbar-track {
    background: transparent;
}

#insights-drawer::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

/* Large screens - Fixed always-visible panel */
@media (min-width: 1400px) {
    #insights-drawer-toggle {
        display: none !important;
    }
    
    #insights-drawer {
        position: fixed !important;
        right: 0 !important;
        top: 120px !important;
        width: 380px !important;
        height: calc(100vh - 140px) !important;
        border-radius: 16px 0 0 16px !important;
        box-shadow: -4px 0 20px rgba(0,0,0,0.1) !important;
    }
    
    /* Shrink projections content to make room for fixed panel */
    .projections-content-wrapper {
        margin-right: 400px !important;
        transition: margin-right 0.3s ease;
    }
}

/* Medium screens (tablet) - Collapsible drawer */
@media (min-width: 769px) and (max-width: 1399px) {
    #insights-drawer-toggle {
        top: 140px !important;
        padding: 12px 16px !important;
        font-size: 13px !important;
    }
    
    #insights-drawer {
        width: 380px !important;
        right: -400px !important;
        top: 120px !important;
        height: calc(100vh - 140px) !important;
    }
    
    #insights-drawer.open {
        right: 0 !important;
    }
    
    .projections-content-wrapper {
        margin-right: 0;
        transition: margin-right 0.3s ease;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    #insights-drawer-toggle {
        position: fixed !important;
        bottom: 20px !important;
        top: auto !important;
        right: 20px !important;
        border-radius: 50px !important;
        padding: 14px 20px !important;
        box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4) !important;
    }
    
    #insights-drawer {
        position: fixed !important;
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: auto !important;
        bottom: 0 !important;
        top: auto !important;
        height: 70vh !important;
        border-radius: 20px 20px 0 0 !important;
        transform: translateY(100%);
        transition: transform 0.3s ease !important;
    }
    
    #insights-drawer.open {
        transform: translateY(0) !important;
    }
    
    .projections-content-wrapper {
        margin-right: 0 !important;
    }
}

/* Advanced Scenario Editor Styles */
.adv-param-row {
    margin-bottom: 10px;
}

.adv-param-row label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    font-size: 13px;
}

.base-value {
    background: #f1f5f9;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
    display: inline-block;
}

.delta-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.adv-category button:hover {
    background: #f8fafc !important;
}

#advanced-scenario-modal .modal-content {
    animation: slideUp 0.3s ease-out;
}

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

/* What Changed Panel Styles */
.what-changed-panel {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    overflow: hidden;
}

.what-changed-header {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.what-changed-row {
    display: grid;
    grid-template-columns: 200px 1fr 50px 1fr;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.what-changed-row:last-child {
    border-bottom: none;
}

.what-changed-row.changed {
    background: #fffbeb;
}

.what-changed-label {
    font-weight: 500;
    color: #374151;
}

.what-changed-base {
    color: #64748b;
    text-align: right;
    padding-right: 10px;
}

.what-changed-arrow {
    color: #94a3b8;
    text-align: center;
}

.what-changed-scenario {
    font-weight: 600;
    padding-left: 10px;
}

.what-changed-scenario.increased {
    color: #166534;
}

.what-changed-scenario.decreased {
    color: #991b1b;
}

.what-changed-scenario.unchanged {
    color: #64748b;
}

/* ==========================================
   PROJECTIONS DASHBOARD MOBILE RESPONSIVE
   ========================================== */

/* Tablet breakpoint */
@media (max-width: 992px) {
    #projections-primary-tabs {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    #projections-primary-tabs button {
        padding: 12px 16px !important;
        font-size: 13px !important;
    }
    
    /* Make Plotly charts responsive */
    .js-plotly-plot, .plotly, [id*="embed-chart"] {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Stack two-column grids */
    .projections-dashboard-fullscreen [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
    #projections-primary-tabs {
        padding: 4px !important;
        border-radius: 10px !important;
        margin-bottom: 16px !important;
    }
    
    #projections-primary-tabs button {
        padding: 10px 12px !important;
        font-size: 12px !important;
        border-radius: 6px !important;
    }
    
    /* Reduce padding on mobile */
    .projections-dashboard-fullscreen {
        padding: 12px !important;
    }
    
    .projections-content-wrapper {
        min-height: auto !important;
    }
    
    /* Stack summary stat cards */
    #projections-statements-container [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    /* Make embedded charts smaller */
    #embed-chart-container {
        height: 250px !important;
    }
    
    /* Reduce table padding */
    #projections-statements-container table td,
    #projections-statements-container table th {
        padding: 6px 8px !important;
        font-size: 11px !important;
    }
    
    /* Insights drawer full width on mobile */
    #insights-drawer {
        width: 100% !important;
        max-width: 100vw !important;
        border-radius: 16px 16px 0 0 !important;
        top: auto !important;
        bottom: 0 !important;
        height: 70vh !important;
    }
    
    #insights-drawer-toggle {
        bottom: 20px !important;
        top: auto !important;
        right: 20px !important;
        border-radius: 12px !important;
    }
}

/* ==========================================
   RISK & GOALS PANELS MOBILE RESPONSIVE
   ========================================== */

@media (max-width: 992px) {
    /* Monte Carlo settings grid */
    #projections-risk-goals-container [style*="grid-template-columns: repeat(3"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Monte Carlo results grid */
    #projections-risk-goals-container [style*="grid-template-columns: repeat(5"] {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
    }
    
    /* Capacity for Loss grid */
    #projections-risk-goals-container [style*="grid-template-columns: repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
}

@media (max-width: 768px) {
    #projections-risk-goals-container {
        padding: 0 !important;
    }
    
    /* All panels reduced padding */
    #projections-risk-goals-container > div {
        padding: 16px !important;
        margin-bottom: 16px !important;
        border-radius: 12px !important;
    }
    
    /* Monte Carlo settings - single column */
    #projections-risk-goals-container [style*="grid-template-columns: repeat(3"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Monte Carlo results - 2 columns */
    #projections-risk-goals-container [style*="grid-template-columns: repeat(5"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Capacity for Loss - single column */
    #projections-risk-goals-container [style*="grid-template-columns: repeat(4"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Monte Carlo chart responsive */
    #monte-carlo-chart {
        height: 250px !important;
    }
    
    /* Run simulation button full width */
    #projections-risk-goals-container button[onclick*="runMonteCarlo"] {
        width: 100% !important;
        margin-top: 12px !important;
    }
    
    /* Goal progress bars */
    #goal-funding-list [style*="flex"] {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    /* Stress test cards */
    #stress-test-results > div {
        padding: 12px !important;
    }
    
    #stress-test-results h4 {
        font-size: 13px !important;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    #projections-primary-tabs {
        margin: 0 -8px 12px -8px !important;
        border-radius: 0 !important;
    }
    
    .journey-nav__action {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }
    
    #monte-carlo-chart {
        height: 200px !important;
    }
    
    /* Probability badge smaller */
    #mc-probability {
        font-size: 24px !important;
    }
}

/* Clickable P&L Row Styles */
.pnl-clickable-row {
    cursor: pointer;
    transition: all 0.15s ease;
}
.pnl-clickable-row:hover {
    background: #e8f5e9 !important;
}
.pnl-clickable-row:hover td {
    color: #1e3a5f !important;
}
.pnl-clickable-row .edit-icon {
    opacity: 0;
    transition: opacity 0.15s ease;
    font-size: 12px;
    color: #94a3b8;
    margin-left: 4px;
}
.pnl-clickable-row:hover .edit-icon {
    opacity: 1;
    color: #1e3a5f;
}
.pnl-expense-row:hover {
    background: #fef2f2 !important;
}
.highlight-row {
    animation: highlight-pulse 1.5s ease-out;
}
@keyframes highlight-pulse {
    0% { background-color: #fef08a; }
    100% { background-color: transparent; }
}

.meeting-mode-btn {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.meeting-mode-btn:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.meeting-setup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.meeting-setup-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}
.meeting-setup-header {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.meeting-setup-header h3 { margin: 0; font-size: 18px; }
.meeting-setup-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
}
.meeting-setup-close:hover { opacity: 1; }
.meeting-setup-body { padding: 24px; max-height: 400px; overflow-y: auto; }
.meeting-slide-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}
.meeting-slide-checklist li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
}
.meeting-slide-checklist li:active { cursor: grabbing; }
.meeting-slide-checklist li.drag-over {
    border-color: #6366f1;
    background: #eef2ff;
}
.meeting-slide-checklist li .slide-drag-handle {
    color: #94a3b8;
    font-size: 16px;
    cursor: grab;
}
.meeting-slide-checklist li input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
}
.meeting-slide-checklist li .slide-label {
    flex: 1;
    font-weight: 500;
    color: #334155;
}
.meeting-setup-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #e2e8f0;
}
.meeting-setup-footer .btn-cancel {
    padding: 10px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-weight: 500;
    color: #64748b;
}
.meeting-setup-footer .btn-cancel:hover { background: #f1f5f9; }
.meeting-setup-footer .btn-start-meeting {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}
.meeting-setup-footer .btn-start-meeting:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}

.meeting-mode-overlay {
    position: fixed;
    inset: 0;
    background: #0f172a;
    z-index: 30000;
    display: flex;
    flex-direction: column;
}
.meeting-mode-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 32px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 1px solid #334155;
    flex-shrink: 0;
}
.meeting-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.meeting-brand-name {
    font-size: 20px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}
.meeting-brand-logo {
    max-height: 36px;
    max-width: 150px;
    object-fit: contain;
}
.meeting-slide-counter {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 500;
}
.meeting-exit-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
}
.meeting-exit-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #f87171;
}
.meeting-slide-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 48px;
    overflow: hidden;
}
.meeting-slide-content {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.meeting-slide-content .meeting-slide-title {
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin-bottom: 24px;
    text-align: center;
}
.meeting-slide-content .meeting-chart-container {
    width: 100%;
    flex: 1;
    min-height: 0;
    background: #1e293b;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #334155;
}
.meeting-slide-content .meeting-summary-card {
    width: 100%;
    max-width: 900px;
    background: #1e293b;
    border-radius: 16px;
    padding: 40px;
    border: 1px solid #334155;
}
.meeting-summary-card .summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 24px;
}
.meeting-summary-card .summary-metric {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    border: 1px solid #475569;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}
.meeting-summary-card .summary-metric .metric-label {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.meeting-summary-card .summary-metric .metric-value {
    font-size: 28px;
    font-weight: 700;
    color: white;
}
.meeting-summary-card .summary-metric .metric-value.positive { color: #4ade80; }
.meeting-summary-card .summary-metric .metric-value.negative { color: #f87171; }
.meeting-nav-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 16px 32px;
    background: #1e293b;
    border-top: 1px solid #334155;
    flex-shrink: 0;
}
.meeting-nav-btn {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 120px;
}
.meeting-nav-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.3);
    color: white;
}
.meeting-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.meeting-progress-dots {
    display: flex;
    gap: 8px;
}
.meeting-progress-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #475569;
    transition: all 0.3s ease;
    cursor: pointer;
}
.meeting-progress-dots .dot.active {
    background: #6366f1;
    transform: scale(1.3);
}
.meeting-progress-dots .dot:hover { background: #64748b; }

@media (max-width: 768px) {
    .meeting-mode-btn { padding: 4px 10px; font-size: 11px; }
    .meeting-slide-area { padding: 12px 16px; }
    .meeting-slide-content .meeting-slide-title { font-size: 22px; }
    .meeting-nav-btn { padding: 8px 14px; font-size: 12px; min-width: 90px; }
    .meeting-mode-topbar { padding: 10px 16px; }
    .meeting-brand-name { font-size: 16px; }
}

.fg-badge {
    display: inline-flex; align-items: center; font-size: 11px; font-weight: 600;
    padding: 2px 9px; border-radius: 20px; white-space: nowrap;
}
.fg-input  { background: rgba(78,205,196,.15); color: #7ee8e1; border: 1px solid rgba(78,205,196,.3); }
.fg-output { background: rgba(99,102,241,.15); color: #a5b4fc; border: 1px solid rgba(99,102,241,.3); }
.fg-report { background: rgba(251,191,36,.12); color: #fcd34d; border: 1px solid rgba(251,191,36,.25); }
.fg-tool   { background: rgba(244,114,182,.12); color: #f9a8d4; border: 1px solid rgba(244,114,182,.25); }

.fg-category { margin-bottom: 20px; }
.fg-cat-title {
    font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: #4ecdc4; margin: 0 0 10px; padding-bottom: 6px;
    border-bottom: 1px solid rgba(78,205,196,.2);
}
.fg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.fg-card {
    display: flex; gap: 12px; padding: 14px; border-radius: 10px;
    background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
    transition: all .2s;
}
.fg-card:hover { background: rgba(255,255,255,.06); }
.fg-link { cursor: pointer; transition: all .15s; }
.fg-link:hover { transform: scale(1.08); filter: brightness(1.3); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.fg-card-icon { font-size: 24px; flex-shrink: 0; line-height: 1; padding-top: 2px; }
.fg-card-body { flex: 1; min-width: 0; }
.fg-card-name { font-size: 14px; font-weight: 600; margin-bottom: 6px; color: #f8fafc; }
.fg-card-paths { display: flex; flex-wrap: wrap; gap: 4px; }

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

@media (max-width: 1024px) {
    .wrapper-holding-row {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 8px !important;
    }
    .wrapper-holding-row .holding-price-info {
        grid-column: 1 / -1 !important;
    }
    .pension-holding-row > div:first-child {
        grid-template-columns: 1fr 1fr 1fr !important;
    }
    .pension-holdings-section > div:first-child,
    .wrapper-holdings-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    .pension-holdings-section > div:first-child > div,
    .wrapper-holdings-header > div {
        flex-wrap: wrap !important;
    }
    #fund-lookup-modal > div,
    #wrapper-fund-lookup-modal > div {
        width: 95% !important;
        max-width: none !important;
    }
}

@media (max-width: 768px) {
    .wrapper-holding-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        padding: 10px !important;
    }
    .pension-holding-row > div:first-child {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }
    .pension-pot-card .form-row {
        flex-direction: column !important;
    }
    .pension-pot-card .form-group.third,
    .pension-pot-card .form-group.half {
        width: 100% !important;
    }
    .pension-pot-card {
        padding: 12px !important;
    }
    .pension-holdings-section {
        margin-top: 10px !important;
        padding-top: 10px !important;
    }
    .wrapper-holdings-section {
        margin-top: 8px !important;
        padding-top: 8px !important;
    }
    #fund-lookup-modal > div {
        max-height: 90vh !important;
        border-radius: 8px !important;
    }
}

@media (max-width: 480px) {
    .wrapper-holding-row {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
    }
    .pension-holding-row > div:first-child {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
    }
    .pension-pot-card {
        padding: 10px !important;
    }
    .pension-pot-card .form-row {
        gap: 8px !important;
    }
}

.journey-timeline-wrapper {
    position: relative;
    padding: 20px 0 0;
}
.journey-timeline-phases {
    position: absolute;
    top: 126px;
    left: 0;
    right: 0;
    height: 12px;
    display: flex;
    z-index: 0;
    border-radius: 6px;
    overflow: hidden;
}
.journey-phase-pre {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    transition: width 0.3s ease;
}
.journey-phase-ret {
    background: linear-gradient(90deg, #22c55e, #16a34a);
    transition: width 0.3s ease;
}
.journey-event-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateX(-50%);
    z-index: 2;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.journey-event-node:hover {
    transform: translateX(-50%) scale(1.08);
}
.journey-event-node:hover .journey-event-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.journey-event-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: relative;
    z-index: 2;
}
.journey-event-label {
    font-size: 11px;
    font-weight: 600;
    color: #334155;
    max-width: 110px;
    text-align: center;
    line-height: 1.3;
    margin-top: 6px;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.journey-event-age {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
}
.journey-event-tooltip {
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: #0f172a;
    color: white;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    pointer-events: none;
}
.journey-event-tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
}
.journey-node-top .journey-event-tooltip {
    bottom: calc(100% + 8px);
}
.journey-node-top .journey-event-tooltip::after {
    top: 100%;
    border-top-color: #0f172a;
}
.journey-node-bottom .journey-event-tooltip {
    top: calc(100% + 8px);
}
.journey-node-bottom .journey-event-tooltip::after {
    bottom: 100%;
    border-bottom-color: #0f172a;
}
.journey-event-card {
    background: white;
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}
.journey-event-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}
.journey-event-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.plan-overview-stat {
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: background 0.15s, border-color 0.15s;
}
.plan-overview-stat:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(78,205,196,0.3);
}
.plan-overview-stat-label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.plan-overview-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: white;
}
.plan-overview-stat-sub {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

/* ===== Simple Mode Toggle ===== */
.simple-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}
.simple-mode-toggle:hover {
    background: rgba(255,255,255,0.18);
}
.simple-mode-toggle .toggle-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
}
.simple-mode-toggle .toggle-track {
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: rgba(255,255,255,0.25);
    position: relative;
    transition: background 0.2s;
}
.simple-mode-toggle .toggle-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: left 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.simple-mode-toggle.active .toggle-track,
body.simple-mode .simple-mode-toggle .toggle-track {
    background: #4ecdc4;
}
.simple-mode-toggle.active .toggle-thumb,
body.simple-mode .simple-mode-toggle .toggle-thumb {
    left: 18px;
}

body.simple-mode .advanced-panel,
body.simple-mode .ff-card[data-advanced="true"],
body.simple-mode .advanced-settings,
body.simple-mode [data-simple-hide="true"] {
    display: none !important;
}
body.simple-mode .simple-mode-badge {
    display: inline-flex;
}

/* ===== Contextual Help Tooltips ===== */
.help-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #4a5568;
    font-size: 11px;
    font-weight: 700;
    cursor: help;
    margin-left: 6px;
    position: relative;
    vertical-align: middle;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}
.help-tip:hover {
    background: #4ecdc4;
    color: white;
}
.help-tip .help-tip-text {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #f1f5f9;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    width: 260px;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    pointer-events: none;
}
.help-tip .help-tip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}
.help-tip:hover .help-tip-text {
    display: block;
}

/* ===== Plan Health Card ===== */
.plan-health-card {
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    border: 2px solid;
    position: relative;
    overflow: hidden;
}
.plan-health-card.health-green {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
}
.plan-health-card.health-amber {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fcd34d;
}
.plan-health-card.health-red {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fca5a5;
}
.plan-health-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.plan-health-indicator {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.health-green .plan-health-indicator { background: #22c55e; color: white; }
.health-amber .plan-health-indicator { background: #f59e0b; color: white; }
.health-red .plan-health-indicator { background: #ef4444; color: white; }
.plan-health-title {
    font-size: 18px;
    font-weight: 700;
}
.health-green .plan-health-title { color: #166534; }
.health-amber .plan-health-title { color: #92400e; }
.health-red .plan-health-title { color: #991b1b; }
.plan-health-score {
    font-size: 13px;
    font-weight: 600;
    margin-top: 2px;
}
.health-green .plan-health-score { color: #15803d; }
.health-amber .plan-health-score { color: #b45309; }
.health-red .plan-health-score { color: #dc2626; }
.plan-health-explanation {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}
.health-green .plan-health-explanation { color: #166534; }
.health-amber .plan-health-explanation { color: #78350f; }
.health-red .plan-health-explanation { color: #7f1d1d; }
.plan-health-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}
.plan-health-metric {
    background: rgba(255,255,255,0.7);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}
.plan-health-metric-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 4px;
}
.plan-health-metric-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

/* ===== Guided Data Entry Flow ===== */
.guided-flow-bar {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: none;
}
.guided-flow-bar.active {
    display: block;
}
.guided-flow-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.guided-flow-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}
.guided-flow-progress-text {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}
.guided-flow-track {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}
.guided-flow-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4, #3db9b0);
    border-radius: 3px;
    transition: width 0.4s ease;
}
.guided-flow-steps {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.guided-flow-step {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}
.guided-flow-step.active {
    background: #4ecdc4;
    color: white;
    border-color: #4ecdc4;
}
.guided-flow-step.completed {
    background: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}
.guided-flow-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.guided-flow-btn.back {
    background: #f1f5f9;
    color: #475569;
}
.guided-flow-btn.back:hover {
    background: #e2e8f0;
}
.guided-flow-btn.next {
    background: linear-gradient(135deg, #4ecdc4, #3db9b0);
    color: white;
}
.guided-flow-btn.next:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(78,205,196,0.4);
}
.guided-flow-bar__inner {
    display: flex;
    align-items: center;
    gap: 12px;
}
.guided-flow-bar__center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.guided-flow-bar__label {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}
.guided-flow-bar__track {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}
.guided-flow-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4, #3db9b0);
    border-radius: 3px;
    transition: width 0.4s ease;
}
.guided-flow-bar__pct {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}
.guided-flow-bar__btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.guided-flow-bar__btn:hover:not(:disabled) {
    background: #f1f5f9;
}
.guided-flow-bar__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.guided-flow-bar__btn--primary {
    background: linear-gradient(135deg, #4ecdc4, #3db9b0);
    color: white;
    border-color: transparent;
}
.guided-flow-bar__btn--primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(78,205,196,0.4);
    background: linear-gradient(135deg, #4ecdc4, #3db9b0);
}

/* ===== Jargon Glossary Panel ===== */
.glossary-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4ecdc4, #3db9b0);
    color: white;
    border: none;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(78,205,196,0.4);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.glossary-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(78,205,196,0.5);
}
.glossary-panel {
    position: fixed;
    bottom: 80px;
    right: 24px;
    width: 380px;
    max-height: 520px;
    background: #1e293b;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.35);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: glossarySlideUp 0.25s ease;
    border: 1px solid rgba(255,255,255,0.08);
}
@keyframes glossarySlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.glossary-panel.open {
    display: flex;
}
.glossary-panel__header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #4ecdc4, #3db9b0);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.glossary-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}
.glossary-search {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}
.glossary-search input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.glossary-search input:focus {
    border-color: #4ecdc4;
}
.glossary-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.glossary-item {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: background 0.15s;
}
.glossary-item:hover {
    background: rgba(255,255,255,0.04);
}
.glossary-term {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 4px;
}
.glossary-definition {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
}
.glossary-empty {
    padding: 24px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}
@media (max-width: 768px) {
    .glossary-panel {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 72px;
        max-height: 60vh;
    }
    .glossary-trigger {
        bottom: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    .simple-mode-toggle .toggle-label {
        display: none;
    }
}

/* ==========================================================
   MOBILE EXPERIENCE POLISH - Task #28
   ========================================================== */

/* --- Dashboard Hamburger Menu Toggle --- */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}
.mobile-nav-toggle:hover {
    background: #f1f5f9;
}
.mobile-nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #475569;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
.mobile-nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mobile-nav-toggle.open span:nth-child(2) {
    opacity: 0;
}
.mobile-nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- Mobile (<768px) Dashboard Header & Nav --- */
@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: flex;
        z-index: 9001;
        position: relative;
    }

    .wealth365-header {
        flex-wrap: wrap;
        padding: 10px 16px;
        gap: 0;
        position: sticky;
        top: 0;
        z-index: 900;
        background: white;
    }

    .header-left {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .header-left .wealth365-logo-text {
        font-size: 18px;
    }

    .header-center {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9000;
        background: rgba(255,255,255,0.98);
        flex-direction: column;
        padding: 72px 24px 24px;
        gap: 4px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        animation: mobileNavSlideIn 0.25s ease;
    }
    @keyframes mobileNavSlideIn {
        from { opacity: 0; transform: translateY(-20px); }
        to { opacity: 1; transform: translateY(0); }
    }
    .header-center.mobile-open {
        display: flex;
    }

    .header-center .view-btn {
        flex-direction: row;
        justify-content: flex-start;
        gap: 14px;
        padding: 16px 20px;
        min-width: unset;
        width: 100%;
        border-radius: 12px;
        min-height: 56px;
        font-size: 16px;
        border: 1px solid #f1f5f9;
    }
    .header-center .view-btn .tab-icon {
        font-size: 22px;
    }
    .header-center .view-btn .tab-label {
        font-size: 15px;
        font-weight: 600;
    }
    .header-center .view-btn.active {
        background: rgba(78, 205, 196, 0.12);
        color: #0d9488;
        border-color: rgba(78, 205, 196, 0.3);
    }

    .header-right {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 0 0;
        order: 3;
    }
    .header-right a {
        padding: 8px 12px;
        font-size: 13px;
    }
    .header-right .client-name {
        font-size: 13px;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .header-right .meeting-mode-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 44px;
    }
    .header-right .settings-btn {
        width: 44px;
        height: 44px;
        min-height: 44px;
    }
    .header-right .nav-dropdown-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 44px;
    }

    /* --- Main content spacing --- */
    .wealth365-main {
        padding: 12px 10px;
    }

    /* --- Overview cards 2-col on mobile --- */
    .overview-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .overview-card {
        padding: 14px 10px;
    }
    .overview-icon {
        font-size: 1.6rem;
    }
    .overview-label {
        font-size: 11px;
    }
    .overview-value {
        font-size: 13px;
    }

    /* --- Fact-find cards single column --- */
    .ff-cards {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .ff-card {
        padding: 14px 16px;
        min-height: 52px;
    }

    /* --- Dashboard Grid --- */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 10px;
    }

    /* --- Projections/Charts view --- */
    .chart-container {
        min-height: 220px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* --- Dashboard tables: card-based layout on mobile --- */
    .dashboard-section table.dashboard-data-table,
    .dashboard-data-table {
        display: block !important;
    }
    .dashboard-data-table thead {
        display: none;
    }
    .dashboard-data-table tbody {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .dashboard-data-table tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding: 12px 14px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        gap: 6px 12px;
    }
    .dashboard-data-table tbody tr:hover {
        transform: none;
    }
    .dashboard-data-table tbody tr.category-row {
        background: #edf2f7;
        padding: 10px 14px;
        border-radius: 8px;
    }
    .dashboard-data-table td {
        display: block;
        padding: 2px 0;
        border-bottom: none;
        font-size: 0.85rem;
    }
    .dashboard-data-table td:first-child {
        width: 100%;
        font-weight: 600;
        font-size: 0.9rem;
        margin-bottom: 2px;
    }
    .dashboard-data-table td:first-child .row-name {
        gap: 8px;
    }
    .dashboard-data-table td:last-child {
        margin-left: auto;
    }
    .dashboard-data-table .amount {
        font-size: 0.9rem;
    }
    .dashboard-data-table .edit-indicator {
        opacity: 1;
        font-size: 0.85rem;
    }

    /* --- Generic tables: scrollable wrapper --- */
    .tab-content,
    .accordion-content,
    .panel-form,
    .modal-body,
    .dashboard-section {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* --- Drilldown tables: card layout --- */
    .drilldown-table {
        display: block;
    }
    .drilldown-table thead {
        display: none;
    }
    .drilldown-table tbody {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    .drilldown-table tbody tr {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 10px;
        padding: 10px 12px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
    }
    .drilldown-table td {
        display: block;
        padding: 2px 0;
        border: none;
        font-size: 12px;
    }
    .drilldown-table td:first-child {
        width: 100%;
        font-weight: 600;
        font-size: 13px;
    }


    /* --- Plotly charts responsive --- */
    .js-plotly-plot,
    .plotly-graph-div {
        width: 100% !important;
    }

    /* --- Compare plans stack --- */
    .compare-plans-container {
        flex-direction: column;
    }
    .compare-results-grid {
        grid-template-columns: 1fr 1fr;
        font-size: 12px;
    }

    /* --- Forms: stack rows, larger inputs --- */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .form-group.half,
    .form-group.third {
        width: 100%;
        min-width: unset;
    }
    .form-group input[type="number"],
    .form-group input[type="text"],
    .form-group input[type="date"],
    .form-group input[type="email"],
    .form-group select,
    .form-group textarea,
    .panel-form input,
    .panel-form select,
    .panel-form textarea {
        font-size: 16px;
        min-height: 44px;
        padding: 10px 12px;
    }

    /* --- Touch targets >= 44px --- */
    .btn-add-item,
    .btn-add-expense,
    .btn-add-income,
    .btn-preset,
    .plan-btn,
    .calculate-btn {
        min-height: 44px;
        padding: 12px 16px;
    }
    .btn-remove-item {
        min-width: 44px;
        min-height: 44px;
        padding: 8px 12px;
    }

    /* --- Modals full-width on mobile --- */
    .modal-dialog,
    .conflict-modal,
    .plan-settings-dialog,
    .expense-dialog,
    .simulation-dialog {
        width: 95vw !important;
        max-width: none !important;
        max-height: 90vh;
        margin: 5vh auto;
    }
    .modal-body {
        padding: 16px;
        max-height: 70vh;
        overflow-y: auto;
    }

    /* --- Drilldown panel full-screen on mobile --- */
    .drilldown-panel {
        width: 100vw !important;
        max-width: 100vw !important;
        right: 0 !important;
        border-radius: 0;
    }

    /* --- Scenarios grid single column --- */
    .scenarios-grid {
        grid-template-columns: 1fr;
    }

    /* --- Result cards 2-col on mobile --- */
    .result-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* --- Plan health card compact --- */
    .plan-health-card {
        padding: 14px;
    }

    /* --- Guided flow bar compact --- */
    .guided-flow-bar__inner {
        flex-wrap: wrap;
        gap: 8px;
    }
    .guided-flow-bar__btn {
        padding: 10px 14px;
        min-height: 44px;
        font-size: 14px;
    }

    /* --- Hero stats --- */
    .hero-stats, .hero-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    /* --- Timeline table --- */
    #timeline-table {
        font-size: 0.75rem;
    }
    #timeline-table th,
    #timeline-table td {
        padding: 6px 8px;
    }

    /* --- Undo toast --- */
    .undo-toast {
        left: 16px;
        right: 16px;
        transform: none;
        bottom: 80px;
    }

    /* --- Net worth summary table --- */
    .net-worth-summary-table {
        font-size: 0.75rem;
    }

    /* --- Journey timeline scroll on mobile --- */
    .journey-timeline-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
    }
    .journey-timeline-wrapper > div {
        min-width: 600px;
    }

    /* --- Feature guide grid --- */
    .fg-grid {
        grid-template-columns: 1fr;
    }

    /* --- Embed dashboard views --- */
    .view-segmented-control {
        flex-wrap: wrap;
        gap: 4px;
    }
    .view-segmented-control button {
        flex: 1 1 auto;
        min-height: 44px;
        font-size: 12px;
        padding: 8px 10px;
    }

    /* --- Surplus account items --- */
    .surplus-account-item {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* --- Pension pots --- */
    .pension-pot-card .form-row {
        flex-direction: column;
    }
    .pension-pot-card .form-group.third,
    .pension-pot-card .form-group.half {
        width: 100%;
    }

    /* --- Meeting mode --- */
    .meeting-slide-area {
        padding: 10px 12px;
    }
    .meeting-slide-content .meeting-slide-title {
        font-size: 20px;
    }

    /* --- Tabs scrollable --- */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding-bottom: 10px;
    }
    .tab-btn {
        flex-shrink: 0;
        white-space: nowrap;
        min-height: 44px;
    }
}

/* --- Extra small (<480px) --- */
@media (max-width: 480px) {
    .overview-cards {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .overview-card {
        padding: 10px 8px;
    }
    .overview-icon { font-size: 1.3rem; }
    .overview-value { font-size: 12px; }
    .overview-label { font-size: 10px; }

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

    .header-right {
        justify-content: center;
    }

    .header-center .view-btn {
        padding: 10px 14px;
        min-height: 44px;
    }

    .wealth365-main {
        padding: 8px 6px;
    }

    .ff-landing__title {
        font-size: 18px;
    }
    .ff-landing__subtitle {
        font-size: 12px;
    }

    .guided-flow-bar__inner {
        gap: 6px;
    }
    .guided-flow-bar__label {
        font-size: 11px;
    }
    .guided-flow-bar__btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* --- Plotly charts auto-resize on orientation change --- */
@media (orientation: landscape) and (max-width: 900px) {
    .chart-container {
        min-height: 200px;
    }
    .js-plotly-plot,
    .plotly-graph-div {
        height: auto !important;
    }
}

/* ==========================================
   #1 - ADDITIONAL MOBILE RESPONSIVE FIXES
   ========================================== */
@media (max-width: 768px) {
    .setup-two-column {
        grid-template-columns: 1fr !important;
    }
    .report-builder-container {
        grid-template-columns: 1fr !important;
    }
    .plan-controls-compact {
        flex-direction: column;
        gap: 8px;
    }
    .plan-controls-compact .plan-selector-group,
    .plan-controls-compact .plan-actions-group {
        width: 100%;
        justify-content: center;
    }
    .scenarios-view .scenario-cards-grid {
        grid-template-columns: 1fr !important;
    }
    .overview-section-grid {
        grid-template-columns: 1fr !important;
    }
    .goals-view-content > div {
        grid-template-columns: 1fr !important;
    }
    .wizard-step-content .household-option {
        min-width: 0 !important;
    }
    #onboarding-wizard-modal .modal-dialog {
        width: 95% !important;
        max-width: none !important;
    }
    #onboarding-wizard-modal [style*="grid-template-columns: repeat(3"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .journey-nav__rail {
        flex-direction: column;
        gap: 8px;
    }
    .journey-nav__action {
        width: 100%;
        justify-content: center;
    }
    .plan-selector-slim {
        width: 100%;
    }
}

/* ==========================================
   #2 - ONBOARDING TOUR OVERLAY
   ========================================== */
.tour-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    transition: opacity 0.3s;
}
.tour-spotlight {
    position: absolute;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.55);
    border-radius: 8px;
    border: 2px solid #4ecdc4;
    z-index: 10001;
    transition: all 0.4s ease;
    pointer-events: none;
}
.tour-tooltip {
    position: absolute;
    z-index: 10002;
    background: #0d1b2a;
    color: #f8fafc;
    border: 1px solid #4ecdc4;
    border-radius: 12px;
    padding: 20px;
    max-width: 340px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.tour-tooltip h4 {
    margin: 0 0 8px;
    font-size: 15px;
    color: #4ecdc4;
}
.tour-tooltip p {
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 1.6;
    color: #cbd5e1;
}
.tour-tooltip-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.tour-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
.tour-btn-skip {
    background: transparent;
    color: #94a3b8;
}
.tour-btn-skip:hover { color: #e2e8f0; }
.tour-btn-next {
    background: #14b8a6;
    color: white;
}
.tour-btn-next:hover { background: #0d9488; }
.tour-progress {
    font-size: 12px;
    color: #64748b;
}

/* ==========================================
   #4 - UNDO TOAST
   ========================================== */
.undo-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: #f8fafc;
    padding: 12px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
    font-size: 14px;
}
.undo-toast.visible {
    transform: translateX(-50%) translateY(0);
}
.undo-toast-btn {
    background: #14b8a6;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
}
.undo-toast-btn:hover { background: #0d9488; }
.undo-toast-timer {
    width: 100%;
    height: 3px;
    background: #334155;
    position: absolute;
    bottom: 0;
    left: 0;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}
.undo-toast-timer-bar {
    height: 100%;
    background: #14b8a6;
    transition: width linear;
}

/* ==========================================
   #8 - NOTIFICATION CENTER
   ========================================== */
.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 6px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 20px;
    transition: color 0.2s;
}
.notification-bell:hover { color: #f8fafc; }
.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: #ef4444;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}
.notification-panel {
    position: fixed;
    top: 0;
    right: -380px;
    width: 380px;
    height: 100vh;
    background: #0f172a;
    border-left: 1px solid #1e293b;
    z-index: 9000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}
.notification-panel.open {
    right: 0;
}
.notification-panel-header {
    padding: 20px;
    border-bottom: 1px solid #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.notification-panel-header h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 16px;
}
.notification-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}
.notification-item {
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: #1e293b;
    border-left: 3px solid #3b82f6;
    cursor: pointer;
    transition: background 0.2s;
}
.notification-item:hover { background: #263548; }
.notification-item.unread { border-left-color: #14b8a6; }
.notification-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 4px;
}
.notification-item-body {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
}
.notification-item-time {
    font-size: 11px;
    color: #475569;
    margin-top: 6px;
}
.notification-empty {
    text-align: center;
    padding: 40px 20px;
    color: #475569;
}

/* ==========================================
   #9 - SKELETON LOADERS (ENHANCED)
   ========================================== */
.skeleton-card {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 20px;
    animation: shimmer 1.5s infinite;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
}
.skeleton-card--dark {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
.skeleton-line {
    height: 14px;
    border-radius: 4px;
    background: rgba(148,163,184,0.2);
    margin-bottom: 10px;
}
.skeleton-line--short { width: 40%; }
.skeleton-line--medium { width: 70%; }
.skeleton-line--full { width: 100%; }
.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(148,163,184,0.2);
}

/* ==========================================
   #10 - ACCESSIBILITY FOCUS STYLES
   ========================================== */
*:focus-visible {
    outline: 2px solid #4ecdc4;
    outline-offset: 2px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    background: #14b8a6;
    color: white;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    z-index: 99999;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.3s;
}
.skip-link:focus {
    top: 0;
}

/* ==========================================
   #12 - COOKIE CONSENT BANNER
   ========================================== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0f172a;
    border-top: 1px solid #1e293b;
    padding: 16px 24px;
    z-index: 9998;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.cookie-banner.visible {
    transform: translateY(0);
}
.cookie-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.cookie-banner-text {
    flex: 1;
    min-width: 280px;
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.6;
}
.cookie-banner-text a {
    color: #4ecdc4;
    text-decoration: underline;
}
.cookie-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.cookie-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
.cookie-btn-accept {
    background: #14b8a6;
    color: white;
}
.cookie-btn-accept:hover { background: #0d9488; }
.cookie-btn-reject {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #334155;
}
.cookie-btn-reject:hover {
    border-color: #94a3b8;
    color: #e2e8f0;
}
@media (max-width: 600px) {
    .cookie-banner-inner {
        flex-direction: column;
        text-align: center;
    }
    .cookie-banner-actions {
        width: 100%;
        justify-content: center;
    }
}

.deep-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #f1f5f9; }
.deep-link { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; color: #475569; background: #f8fafc; border: 1px solid #e2e8f0; cursor: pointer; text-decoration: none; transition: all 0.15s; white-space: nowrap; }
.deep-link:hover { background: #eef2ff; border-color: #818cf8; color: #4338ca; }
.deep-link .dl-icon { font-size: 11px; opacity: 0.7; }
.deep-link-divider { width: 1px; height: 18px; background: #e2e8f0; align-self: center; margin: 0 2px; }

#overview-tabs { flex-wrap: wrap; }
@media (max-width: 640px) {
    #overview-tabs { flex-direction: column; border-radius: 10px; }
    #overview-tabs .overview-tab { border-left: none !important; border-top: 1px solid #e2e8f0; }
    #overview-tabs .overview-tab:first-child { border-top: none; }
}
.overview-tab:hover { opacity: 0.9; }
