/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Header */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header h2 {
    font-size: 1.5rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.operation-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.summary-item {
    background: rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.summary-item .label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.summary-item .value {
    font-size: 1.3rem;
    font-weight: bold;
}

.value.positive { color: #2ecc71; }
.value.negative { color: #e74c3c; }
.value.warning { color: #f39c12; }

/* Navigation */
.navigation {
    background: #34495e;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-btn {
    flex: 1;
    min-width: 150px;
    padding: 1rem;
    background: transparent;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    border-bottom: 3px solid transparent;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: rgba(255,255,255,0.2);
    border-bottom-color: #3498db;
}

/* Content */
.content {
    padding: 2rem;
}

.section {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.section.active {
    display: block;
}

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

.section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.5rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: 5px solid #3498db;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card.positive {
    border-left-color: #2ecc71;
    background: linear-gradient(135deg, #ffffff 0%, #f8fff9 100%);
}

.card.negative {
    border-left-color: #e74c3c;
    background: linear-gradient(135deg, #ffffff 0%, #fff8f8 100%);
}

.card.warning {
    border-left-color: #f39c12;
    background: linear-gradient(135deg, #ffffff 0%, #fffdf8 100%);
}

.card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.card ul {
    list-style: none;
    padding-left: 0;
}

.card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #ecf0f1;
    position: relative;
    padding-left: 1.5rem;
}

.card li:before {
    content: "▶";
    position: absolute;
    left: 0;
    color: #3498db;
    font-size: 0.8rem;
}

.card li:last-child {
    border-bottom: none;
}

/* Alerts */
.alert {
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    border-left: 5px solid;
}

.alert-warning {
    background: #fff3cd;
    border-left-color: #f39c12;
    color: #856404;
}

.alert-danger {
    background: #f8d7da;
    border-left-color: #e74c3c;
    color: #721c24;
}

.alert h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Risk Grid */
.risk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.risk-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-top: 5px solid;
    transition: transform 0.3s ease;
}

.risk-card:hover {
    transform: translateY(-5px);
}

.risk-card.critical {
    border-top-color: #e74c3c;
    background: linear-gradient(135deg, #ffffff 0%, #fff5f5 100%);
}

.risk-card.high {
    border-top-color: #f39c12;
    background: linear-gradient(135deg, #ffffff 0%, #fffbf5 100%);
}

.risk-card.medium {
    border-top-color: #f1c40f;
    background: linear-gradient(135deg, #ffffff 0%, #fffef5 100%);
}

.risk-level {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.risk-card.critical .risk-level {
    background: #e74c3c;
    color: white;
}

.risk-card.high .risk-level {
    background: #f39c12;
    color: white;
}

.risk-card.medium .risk-level {
    background: #f1c40f;
    color: #333;
}

/* Recommendations */
.recommendations {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.recommendation.immediate {
    border-left-color: #e74c3c;
}

.recommendation.contractual {
    border-left-color: #3498db;
}

.rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.rec-item {
    background: rgba(52, 152, 219, 0.05);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(52, 152, 219, 0.1);
}

.rec-item h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Financial Table */
.financial-table {
    overflow-x: auto;
    margin: 2rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

th {
    background: #34495e;
    color: white;
    font-weight: 600;
}

.positive-row {
    background: rgba(46, 204, 113, 0.05);
}

.negative-row {
    background: rgba(231, 76, 60, 0.05);
}

.warning-row {
    background: rgba(243, 156, 18, 0.05);
}

.total-row {
    background: #2c3e50;
    color: white;
    font-weight: bold;
}

.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.badge.positive {
    background: #2ecc71;
    color: white;
}

.badge.negative {
    background: #e74c3c;
    color: white;
}

.badge.warning {
    background: #f39c12;
    color: white;
}

/* Charts */
.financial-charts {
    margin: 2rem 0;
}

.chart-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.pie-chart {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 2rem auto;
    background: conic-gradient(
        #3498db 0% 3%,
        #f39c12 3% 25%,
        #e74c3c 25% 100%
    );
    position: relative;
}

.pie-chart::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.color-box.acquisition {
    background: #3498db;
}

.color-box.cca {
    background: #f39c12;
}

.color-box.passifs {
    background: #e74c3c;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

.footer p {
    margin: 0.5rem 0;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        margin: 0;
    }
    
    .header {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header h2 {
        font-size: 1.2rem;
    }
    
    .content {
        padding: 1rem;
    }
    
    .navigation {
        flex-direction: column;
    }
    
    .nav-btn {
        min-width: auto;
    }
    
    .operation-summary {
        grid-template-columns: 1fr;
    }
    
    .risk-grid {
        grid-template-columns: 1fr;
    }
    
    .rec-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-legend {
        flex-direction: column;
        align-items: center;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .navigation {
        display: none;
    }
    
    .section {
        display: block !important;
        page-break-after: always;
    }
    
    .card {
        break-inside: avoid;
    }
}