/* Variables globales */
:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --background-color: #f5f7fa;
    --text-color: #333;
    --border-color: #ddd;
    --warning-color: #e74c3c;
    --success-color: #2ecc71;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    overscroll-behavior: none;
}

/* Header */
header {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 1.2rem 1.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    flex-grow: 1;
}

.header-nav {
    margin-left: 2rem;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: .2rem;
    color: var(--primary-color);
    font-weight: 600;
}

small {
    color: #666;
    font-size: 0.9rem;
}

.admin-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.admin-link:hover {
    background-color: var(--secondary-color);
}

/* Canvas (graphique) */
canvas {
    display: block;
    width: 100%;
    max-width: 1000px;
    height: 400px;
    margin: 2rem auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    background: #fff;
}

/* Sections */
section {
    margin: 2rem auto;
    max-width: 1000px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 1rem;
}

section.hist {
    max-height: 320px;
    overflow: auto;
}

/* Tableaux */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th,
td {
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.8rem;
    text-align: center;
}

th {
    background: #f5f5f5;
    position: sticky;
    top: 0;
    font-weight: 600;
}

/* Récapitulatif */
#recap table {
    margin: 0 auto;
}

#recap th {
    background: #f0f7ff;
    color: var(--primary-color);
}

/* Footer */
footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem auto;
    padding: 1rem 1.4rem;
    max-width: 1000px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.footer-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

input[type="date"] {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
}

#jsonLink {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

#jsonLink:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

#updateStatus {
    font-size: 0.9rem;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-nav {
        margin-left: 0;
        margin-top: 1rem;
    }

    canvas {
        height: 300px;
    }

    footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}