/* 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: 1400px;
    margin: 0 auto;
    padding: 20px;
}

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

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

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Formulaire */
.form-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 30px;
    margin-bottom: 30px;
}

/* Sections pliables */
.section {
    margin-bottom: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
}

.section-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.section-header:hover {
    background: linear-gradient(135deg, #3d8bfe 0%, #00d4fe 100%);
}

.section-header h2 {
    font-size: 1.3rem;
    margin: 0;
}

.toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.section-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.section-content {
    padding: 20px;
    display: block;
    transition: all 0.3s ease;
}

.section-content.collapsed {
    display: none;
}

/* Form groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.radio-group input[type="radio"] {
    width: auto;
    margin: 0;
}

/* Info boxes */
.growth-info,
.churn-info,
.costs-info,
.marketing-info,
.licenses-info,
.costs-preview {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #4facfe;
}

.costs-preview {
    margin-top: 20px;
    background: #e8f4fd;
    border-left-color: #007bff;
}

.costs-preview h4 {
    margin-bottom: 15px;
    color: #333;
}

.costs-preview span {
    font-weight: bold;
    color: #007bff;
}

/* Coefficients de scénarios */
.coeff-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.coeff-inputs label {
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

.coeff-inputs input {
    width: 100%;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.coeff-inputs input:focus {
    border-color: #4facfe;
    outline: none;
}

/* Plan de trésorerie */
.cashflow-container {
    margin: 20px 0;
}

.yearly-table {
    margin-bottom: 30px;
}

.monthly-details {
    margin-top: 20px;
}

.year-detail {
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: #f8f9fa;
}

.year-detail h5 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #4facfe;
    padding-bottom: 5px;
}

.monthly-table {
    font-size: 0.9rem;
}

.monthly-table th,
.monthly-table td {
    padding: 8px;
    text-align: center;
}

.monthly-table th {
    background: #e9ecef;
    font-weight: 600;
}

/* Alertes pour la trésorerie */
.alert {
    background: #f8d7da !important;
    color: #721c24 !important;
}

.warning {
    background: #fff3cd !important;
    color: #856404 !important;
}

/* Contrôles de répartition d'investissement */
.investment-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.investment-controls .form-group {
    margin-bottom: 10px;
}

.investment-controls label {
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

.investment-controls input {
    width: 100%;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.investment-controls input:focus {
    border-color: #4facfe;
    outline: none;
}

/* Tableau des salaires masqué */
.salary-table-container {
    margin-top: 20px;
}

.salary-table-container h4 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #4facfe;
    padding-bottom: 5px;
}

/* Section Acquisition Avancée */
.acquisition-advanced {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.acquisition-advanced h4 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #4facfe;
    padding-bottom: 5px;
}

.info-text {
    background: #e3f2fd;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #2196f3;
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.info-text strong {
    color: #1976d2;
}

.user-management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.user-management-grid .form-group {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.user-management-grid label {
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    display: block;
}

.user-management-grid input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 5px;
}

.user-management-grid input:focus {
    border-color: #4facfe;
    outline: none;
}

.user-management-grid small {
    color: #666;
    font-size: 0.85rem;
}

/* Section répartition investissement */
.investment-breakdown {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.investment-breakdown h4 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.1rem;
}

.investment-breakdown table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.investment-breakdown th,
.investment-breakdown td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.investment-breakdown th {
    background: #e9ecef;
    font-weight: 600;
    color: #495057;
}

.investment-breakdown td:last-child {
    text-align: right;
    font-weight: 600;
    color: #28a745;
}

/* Styles pour l'impression */
@media print {
    .form-container {
        display: none !important;
    }
    
    .action-buttons {
        display: none !important;
    }
    
    .results-container {
        display: block !important;
    }
    
    .results-container * {
        color: black !important;
        background: white !important;
    }
    
    .chart-container {
        page-break-inside: avoid;
    }
    
    .section {
        page-break-inside: avoid;
    }
    
    .tab-content {
        display: block !important;
    }
    
    .tab-content > div {
        display: block !important;
        margin-bottom: 30px;
    }
}


.growth-info p,
.churn-info p,
.costs-info p,
.marketing-info p,
.licenses-info p {
    margin: 5px 0;
    font-size: 0.95rem;
}

.costs-info ul {
    margin: 10px 0;
    padding-left: 20px;
}

/* Tableau des salaires */
.salary-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

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

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

.salary-table th {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-weight: 600;
}

.salary-table tr:hover {
    background: #f8f9fa;
}

.salary-table input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Nouveaux styles pour le tableau des salaires cohérent */
.salary-summary {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.salary-summary h3 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #4facfe;
    padding-bottom: 10px;
}

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

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

.summary-table th {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    font-weight: 600;
}

.summary-table tr:hover {
    background: #f8f9fa;
}

.salary-details {
    margin-bottom: 30px;
}

.salary-details h3 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #4facfe;
    padding-bottom: 10px;
}

.salary-note {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #2196f3;
    margin-top: 20px;
}

.salary-note p {
    margin: 0;
    color: #1976d2;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Styles pour l'onglet Postes & Salaires */
.positions-summary {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.positions-summary h3 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #4facfe;
    padding-bottom: 10px;
}

.positions-info {
    background: #e3f2fd;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #2196f3;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.positions-info strong {
    color: #1976d2;
}

.positions-table-container {
    overflow-x: auto;
    margin-bottom: 30px;
}

.positions-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 800px;
}

.positions-table th {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-weight: 600;
    padding: 12px 8px;
    text-align: center;
    border-bottom: 2px solid #3d8bfe;
}

.positions-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.positions-table tr:hover {
    background: #f8f9fa;
}

.positions-table .number {
    font-weight: 600;
    color: #495057;
}

.positions-table .currency {
    font-weight: 500;
    color: #28a745;
}

.positions-table .currency.total {
    font-weight: 700;
    color: #155724;
    background: #d4edda;
}

.positions-table .total-row {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    font-weight: 700;
}

.positions-table .total-row td {
    border-top: 2px solid #28a745;
    border-bottom: 2px solid #28a745;
}

.positions-breakdown {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.positions-breakdown h4 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #28a745;
    padding-bottom: 8px;
}

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

.breakdown-table th {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    font-weight: 600;
    padding: 12px;
    text-align: center;
}

.breakdown-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.breakdown-table tr:hover {
    background: #f8f9fa;
}

.breakdown-table td:last-child {
    font-weight: 700;
    color: #155724;
    background: #d4edda;
}

.positions-note {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    margin-top: 15px;
}

.positions-note p {
    margin: 5px 0;
    color: #856404;
    font-size: 0.95rem;
    line-height: 1.4;
}

.positions-note strong {
    color: #533f03;
}

/* Ligne d'information dans le tableau */
.info-row {
    background: #f8f9fa !important;
    border-top: 2px solid #dee2e6;
}

.info-row td {
    background: #e9ecef !important;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Coefficients de scénarios */
.scenario-coeffs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.scenario-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #4facfe;
}

.scenario-box h3 {
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

.scenario-box ul {
    list-style: none;
}

.scenario-box li {
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

/* Boutons d'action */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #007bff 0%, #6610f2 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #520dc2 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.btn-tertiary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.btn-tertiary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #343a40 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

/* Résultats */
.results-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 30px;
    margin-top: 30px;
}

/* Onglets */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    overflow-x: auto;
}

.tab-button {
    background: #f8f9fa;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-button:hover {
    background: #e9ecef;
    color: #333;
}

.tab-button.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.tab-content {
    display: none;
}

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

/* KPI Cards */
.kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.kpi-card h3 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: bold;
}

/* Charts */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.chart-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chart-container h3 {
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

.chart-container canvas {
    max-width: 100%;
    height: 300px;
    max-height: 300px;
}

/* Tableaux */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

table th {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-weight: 600;
}

table tr:hover {
    background: #f8f9fa;
}

table tr.alert {
    background: #f8d7da;
    color: #721c24;
}

table tr.success {
    background: #d4edda;
    color: #155724;
}

/* Alertes */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 600;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .section-header {
        padding: 12px 15px;
    }
    
    .section-header h2 {
        font-size: 1.1rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .kpi-cards {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-button {
        border-radius: 8px;
        margin-bottom: 5px;
    }
    
    .salary-table-container {
        font-size: 0.9rem;
    }
    
    .scenario-coeffs {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .radio-group {
        flex-direction: column;
    }
    
    .kpi-cards {
        grid-template-columns: 1fr;
    }
    
    .chart-container canvas {
        height: 250px;
    }
}

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

.tab-content.active {
    animation: fadeIn 0.3s ease;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #3d8bfe 0%, #00d4fe 100%);
}
