/* ====== Simulateur Layout ====== */
.simulateur-section {
    padding: var(--space-2xl) 0;
}

.simulateur-title {
    text-align: center;
    margin-bottom: var(--space-sm);
}

.simulateur-subtitle {
    text-align: center;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-xl);
}

.simulateur-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: start;
}

/* ====== Input Sections ====== */
.simulateur-inputs {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.input-section {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.input-section-title {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

.input-section-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-section-icon svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.input-group {
    margin-bottom: var(--space-md);
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.input-with-unit {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.2s;
}

.input-with-unit:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.input-with-unit input {
    flex: 1;
    border: none;
    padding: 10px 12px;
    font-size: 0.95rem;
    font-family: var(--font);
    outline: none;
    background: transparent;
    min-width: 0;
}

.input-with-unit input[readonly] {
    color: var(--text-muted);
    background: var(--bg);
}

.input-unit {
    padding: 10px 12px;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    border-left: 1px solid var(--border);
}

.input-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: var(--font);
    background: var(--bg-white);
    color: var(--text);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}

select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* ====== Results Panel ====== */
.simulateur-results {
    position: relative;
}

.results-sticky {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.results-title {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: var(--space-sm);
}

/* ====== Verdict ====== */
.result-verdict {
    text-align: center;
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.verdict-excellent {
    background: var(--positive-bg);
    color: #065f46;
}

.verdict-bon {
    background: #dbeafe;
    color: #1e40af;
}

.verdict-moyen {
    background: #fef3c7;
    color: #92400e;
}

.verdict-risque {
    background: var(--negative-bg);
    color: #991b1b;
}

/* ====== Metrics Cards ====== */
.results-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.metric-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
}

.metric-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.metric-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}

.metric-gauge {
    height: 4px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    margin-top: var(--space-sm);
    overflow: hidden;
}

.metric-gauge-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--primary);
    transition: width 0.4s ease;
}

/* ====== Cash-flow Card ====== */
.cashflow-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.cashflow-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
}

.cashflow-row:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}

.cashflow-row span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.cashflow-row strong {
    font-size: 1.1rem;
}

.cashflow-positive {
    color: var(--positive);
}

.cashflow-negative {
    color: var(--negative);
}

/* ====== Detail Card ====== */
.detail-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.detail-card h3 {
    font-size: 0.95rem;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-light);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.85rem;
}

.detail-row span:first-child {
    color: var(--text-secondary);
}

.detail-row span:last-child {
    font-weight: 600;
}

.detail-row-total {
    border-top: 1px solid var(--border);
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    font-weight: 700;
}

.detail-row-total span {
    font-weight: 700 !important;
}

/* ====== Charges Chart ====== */
.charges-chart {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.charge-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.8rem;
}

.charge-bar-label {
    width: 120px;
    flex-shrink: 0;
    color: var(--text-secondary);
    text-align: right;
}

.charge-bar-track {
    flex: 1;
    height: 20px;
    background: var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.charge-bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    background: var(--primary);
    transition: width 0.4s ease;
    min-width: 2px;
}

.charge-bar-value {
    width: 70px;
    flex-shrink: 0;
    font-weight: 600;
    font-size: 0.8rem;
}

/* ====== Amortization Table ====== */
.amort-table-wrap {
    overflow-x: auto;
}

.amort-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.amort-table th {
    background: var(--bg);
    padding: 8px 12px;
    text-align: right;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.amort-table th:first-child {
    text-align: left;
}

.amort-table td {
    padding: 8px 12px;
    text-align: right;
    border-bottom: 1px solid var(--border-light);
}

.amort-table td:first-child {
    text-align: left;
    font-weight: 600;
}

/* ====== Results Actions ====== */
.results-actions {
    position: sticky;
    bottom: 0;
    background: linear-gradient(to bottom, transparent, var(--bg) 20%);
    padding: var(--space-lg) 0 var(--space-xs);
    margin-top: var(--space-sm);
    z-index: 5;
}

/* ====== Dashboard simulation detail ====== */
.simulation-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.simulation-date-detail {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.report-cta {
    background: linear-gradient(135deg, var(--primary-bg) 0%, #ddd6fe 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    text-align: center;
}

.report-cta h3 {
    margin-bottom: var(--space-sm);
}

.report-cta p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.report-available {
    background: var(--positive-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
}

.report-available p {
    margin-top: var(--space-sm);
    color: #065f46;
}
