:root {
    --marine: #001B48;
    --bleu: #02457A;
    --turquoise: #77CED9;
    --turquoise-clair: #C5EAEF;
    --quasi-blanc: #F0F7FA;
    --accent: #E70C83;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Calibri, sans-serif;
    margin: 0;
    background: var(--quasi-blanc);
    color: var(--marine);
}

.topbar {
    background: var(--marine);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.topbar a { color: white; text-decoration: none; margin-right: 14px; }
.topbar a:hover { text-decoration: underline; }

.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown summary {
    color: white;
    cursor: pointer;
    list-style: none;
    margin-right: 14px;
    display: inline-block;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary::after { content: ' ▾'; }
.nav-dropdown[open] summary::after { content: ' ▴'; }
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    min-width: 200px;
    z-index: 10;
    padding: 6px 0;
}
.nav-dropdown-menu a {
    display: block;
    color: var(--marine) !important;
    padding: 8px 14px;
    margin-right: 0 !important;
    text-decoration: none !important;
}
.nav-dropdown-menu a:hover { background: var(--quasi-blanc); }
.badge-demo {
    background: var(--accent);
    font-size: 0.65em;
    padding: 2px 8px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 8px;
}

main { padding: 20px; }

.login-page { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 300px;
}
.login-box label { display: block; margin-bottom: 12px; font-size: 0.9em; }
.login-box input { width: 100%; padding: 8px; margin-top: 4px; }
.login-box button {
    width: 100%; padding: 10px; background: var(--bleu); color: white;
    border: none; border-radius: 4px; cursor: pointer; margin-top: 10px;
}
.subtitle { color: #888; font-size: 0.8em; margin-top: -10px; }
.error { color: var(--accent); font-weight: bold; }

.day-tabs { margin-bottom: 10px; }
.day-tabs a {
    display: inline-block; padding: 8px 14px; margin-right: 4px;
    background: white; color: var(--marine); text-decoration: none; border-radius: 4px 4px 0 0;
}
.day-tabs a.active { background: var(--bleu); color: white; }

table.horaire-grid, table.data-table {
    border-collapse: collapse;
    width: 100%;
    background: white;
}
table.horaire-grid th, table.horaire-grid td,
table.data-table th, table.data-table td {
    border: 1px solid #ddd;
    padding: 4px 6px;
    text-align: left;
    font-size: 0.85em;
}
table.horaire-grid th { color: var(--marine); }
.slot-form { display: flex; gap: 2px; }
.slot-form select { font-size: 0.8em; max-width: 110px; }
.hors-horaire { color: #bbb; font-size: 0.8em; }
.cellule-absence { outline: 2px solid var(--accent); outline-offset: -2px; }
.alerte-absence { color: var(--accent); font-weight: bold; }
.ecart-neg { color: var(--accent); font-weight: bold; }
.ecart-pos { color: #2E7D32; font-weight: bold; }

.pastille {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
    margin-right: 4px; border: 1px solid rgba(0,0,0,0.2);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    background: white;
    padding: 16px;
    border-radius: 6px;
    max-width: 900px;
}
.form-grid label { font-size: 0.85em; display: flex; flex-direction: column; gap: 4px; }
.form-grid input, .form-grid select { padding: 6px; }
.form-grid button { grid-column: 1 / -1; padding: 10px; background: var(--bleu); color: white; border: none; border-radius: 4px; cursor: pointer; }

.inline-form { display: inline; }
.champ-edit select { max-width: 130px; font-size: 0.85em; }
.champ-nombre { width: 50px; font-size: 0.85em; }

.week-selector { margin-bottom: 10px; }
.legende-couleurs { font-size: 0.8em; color: #555; }

.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin: 16px 0 24px;
    max-width: 800px;
}
.kpi-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.kpi-label { font-size: 0.75em; color: #777; }
.kpi-valeur { font-size: 1.6em; font-weight: 500; color: var(--marine); }
.kpi-valeur small { font-size: 0.5em; color: #888; font-weight: 400; }

.chart-wrap {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 220px;
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    box-sizing: border-box;
}
.chart-jour { height: 260px; }

.groupe-card {
    background: white;
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 14px;
    max-width: 500px;
}
.groupe-card h2 { margin: 0 0 10px; font-size: 1.1em; }
.groupe-card h2 small { font-weight: normal; color: #777; margin-left: 8px; }
.groupe-card form { margin-bottom: 10px; }
.patient-multiselect { width: 100%; }

.fiche { background: white; padding: 20px; max-width: 900px; }
.fiche h1 {
    font-size: 1.2em;
    padding: 10px 14px;
    border-radius: 6px;
    color: var(--marine);
}
.fiche-table { width: 100%; border-collapse: collapse; }
.fiche-table th, .fiche-table td {
    border: 1px solid #ccc;
    padding: 5px 8px;
    font-size: 0.85em;
    text-align: left;
}
.fiche-table th { background: var(--turquoise-clair); }
.hors-horaire-fiche { background: #f2f2f2; }
.int-ext { color: #777; font-size: 0.85em; }

@media print {
    .topbar, .no-print { display: none !important; }
    body { background: white; }
    .fiche { padding: 0; }
}
