/* --- Base et Typo --- */
body {
    font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 10px;
    background: #f4f4f4;
    color: #333;
    line-height: 1.5;
}

.container {
    background: white;
    padding: 15px;
    border-radius: 8px;
    max-width: 600px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin: 0 auto 20px auto;
}

/* --- Navigation (Style Boutons) --- */
nav {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

nav a {
    background: #ffffff;
    padding: 10px 15px;
    border-radius: 6px;
    text-decoration: none;
    color: #007bff;
    font-size: 0.9em;
    font-weight: bold;
    border: 1px solid #ddd;
    flex-grow: 1;
    text-align: center;
    max-width: 150px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

nav a:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

/* --- Formulaires --- */
label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em;
}

input, select {
    margin-bottom: 15px;
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px; /* Empeche le zoom auto sur mobile */
}

/* --- Boutons --- */
button, .btn-action {
    width: 100%;
    padding: 15px;
    cursor: pointer;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-sizing: border-box;
    transition: background 0.2s;
}

button:hover { background: #0056b3; }

.btn-success { background: #28a745; }
.btn-success:hover { background: #218838; }

/* --- Tableaux et Stats --- */
.table-wrapper { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 400px;
}

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

.card {
    background: #e7f3ff;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 5px solid #007bff;
}

.result {
    background: #fff3cd;
    padding: 15px;
    margin-top: 20px;
    border-radius: 6px;
    border: 1px solid #ffeeba;
}

/* Graphique Camembert */
.chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

.pie {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    transform: rotate(-90deg);
}

.legend {
    margin-top: 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

.legend-item {
    font-size: 0.8em;
    display: flex;
    align-items: center;
}

.color-box {
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border-radius: 2px;
}

/* Alertes d'erreurs de calcul */
.error-box {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    margin-bottom: 20px;
}

.error-box ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.error-box strong {
    display: block;
}
