:root{--bg:#f6f7f9;--panel:#fff;--text:#171717;--muted:#6b7280;--border:#e5e7eb;--accent:#111827;--danger:#b91c1c;--today:#eef2ff}
html[data-theme=dark]{--bg:#111318;--panel:#191c22;--text:#f3f4f6;--muted:#9ca3af;--border:#2b3038;--accent:#f3f4f6;--danger:#f87171;--today:#252b3d}
@media(prefers-color-scheme:dark){html[data-theme=system]{--bg:#111318;--panel:#191c22;--text:#f3f4f6;--muted:#9ca3af;--border:#2b3038;--accent:#f3f4f6;--danger:#f87171;--today:#252b3d}}
*{box-sizing:border-box}body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,sans-serif;background:var(--bg);color:var(--text)}a{color:inherit;text-decoration:none}button,input,select,textarea{font:inherit}.shell{display:grid;grid-template-columns:240px 1fr;min-height:100vh}.sidebar{position:sticky;top:0;height:100vh;padding:22px;background:var(--panel);border-right:1px solid var(--border);display:flex;flex-direction:column}.brand{font-weight:800;font-size:1.25rem;margin-bottom:24px}.sidebar nav{display:grid;gap:6px}.sidebar nav a,.logout{padding:10px 12px;border-radius:10px}.sidebar nav a:hover,.logout:hover{background:var(--bg)}.logout{margin-top:auto}.content{padding:24px;min-width:0}.topbar{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:20px}.topbar h1{margin:0}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px}.card{background:var(--panel);border:1px solid var(--border);border-radius:16px;padding:18px;margin-bottom:16px}.metric{font-size:1.5rem;font-weight:700}.muted{color:var(--muted)}.muted-row{opacity:.45}.item{display:grid;grid-template-columns:auto 1fr;gap:4px 8px;padding:10px;border-bottom:1px solid var(--border);border-radius:10px;margin:5px 0}.item small{grid-column:2;color:var(--muted)}.dot{width:10px;height:10px;border-radius:99px;display:inline-block}.btn{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:10px;padding:10px 14px;background:var(--accent);color:var(--bg);cursor:pointer}.btn.secondary{background:transparent;color:var(--text);border:1px solid var(--border)}.filters,.inline-form,.actions,.calendar-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:16px}.check-inline{display:flex!important;align-items:center!important;gap:6px}.check-inline input{width:auto}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.form-grid label{display:grid;gap:6px}.wide{grid-column:1/-1}input,select,textarea{width:100%;border:1px solid var(--border);border-radius:10px;padding:10px;background:var(--panel);color:var(--text)}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:10px;border-bottom:1px solid var(--border);white-space:nowrap}.link-danger{border:0;background:none;color:var(--danger);cursor:pointer;padding:0}.actions form{display:inline}.alert{padding:12px;border-radius:10px;background:var(--bg);margin-bottom:12px}.alert.error{color:var(--danger)}.auth{min-height:100vh;display:grid;place-items:center;padding:20px}.auth-card{width:min(420px,100%);background:var(--panel);padding:24px;border-radius:16px;border:1px solid var(--border);display:grid;gap:16px}.subject-row{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--border)}
.section-link:hover{text-decoration:underline}.task-box,.exam-box{transition:.15s}.task-box:hover,.exam-box:hover{transform:translateY(-1px)}
.status-todo{background:rgba(245,158,11,.10)}.status-in_progress{background:rgba(59,130,246,.12)}.status-done{background:rgba(34,197,94,.12)}.status-postponed{background:rgba(168,85,247,.12)}.status-cancelled{background:rgba(107,114,128,.12);opacity:.65}.status-overdue{background:rgba(239,68,68,.12)}.priority-high{background:rgba(239,68,68,.09)}.priority-medium{background:rgba(245,158,11,.09)}.priority-low{background:rgba(34,197,94,.09)}
.task-row.status-todo td{background:rgba(245,158,11,.05)}.task-row.status-in_progress td{background:rgba(59,130,246,.06)}.task-row.status-done td{background:rgba(34,197,94,.06)}.task-row.status-postponed td{background:rgba(168,85,247,.06)}.task-row.status-cancelled td{background:rgba(107,114,128,.05)}
#calendar{display:grid;gap:10px}.cal-weekdays{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;text-align:center;color:var(--muted);font-size:.8rem}.cal-grid,.cal-week-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}.cal-day{min-height:120px;border:1px solid var(--border);border-radius:10px;padding:8px;transition:.15s}.cal-day.today{background:var(--today);border:2px solid var(--accent)}.cal-day.compact{min-height:180px}.cal-day.drag-over{outline:2px solid var(--accent)}.cal-day header{font-weight:700;margin-bottom:6px}.cal-event{display:block;padding:5px 6px;border-radius:7px;margin:4px 0;font-size:.86rem;border-left:4px solid var(--event-color,#64748b);background:var(--bg)}.cal-event.task{cursor:grab}.cal-event.exam{font-weight:700}.cal-event.status-done{text-decoration:line-through}.cal-day-view{max-width:720px}
@media(max-width:800px){.shell{display:block}.sidebar{position:fixed;z-index:10;bottom:0;top:auto;width:100%;height:auto;border-right:0;border-top:1px solid var(--border);padding:6px}.sidebar .brand,.sidebar .logout{display:none}.sidebar nav{grid-template-columns:repeat(6,1fr);gap:2px}.sidebar nav a{font-size:.7rem;text-align:center;padding:8px 3px}.content{padding:16px 12px 78px}.topbar{align-items:flex-start}.form-grid{grid-template-columns:1fr}.wide{grid-column:auto}.cal-weekdays{display:none}.cal-grid,.cal-week-grid{grid-template-columns:1fr}.cal-day,.cal-day.compact{min-height:auto}}
/* Correctif 1.1.1 — visibilité des sélecteurs date/heure */
html[data-theme="light"] input[type="date"],
html[data-theme="light"] input[type="time"],
html[data-theme="light"] input[type="datetime-local"] {
    color-scheme: light;
}

html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="time"],
html[data-theme="dark"] input[type="datetime-local"] {
    color-scheme: dark;
}

@media (prefers-color-scheme: light) {
    html[data-theme="system"] input[type="date"],
    html[data-theme="system"] input[type="time"],
    html[data-theme="system"] input[type="datetime-local"] {
        color-scheme: light;
    }
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] input[type="date"],
    html[data-theme="system"] input[type="time"],
    html[data-theme="system"] input[type="datetime-local"] {
        color-scheme: dark;
    }
}

/* Chromium/WebKit : icône visible sur fond clair */
html[data-theme="light"] input::-webkit-calendar-picker-indicator {
    opacity: .75;
    filter: none;
    cursor: pointer;
}
/* Correctif 1.1.2 — sélecteurs date/heure visibles */
input[type="date"],
input[type="time"],
input[type="datetime-local"]{
    position:relative;
}

html[data-theme="light"] input[type="date"],
html[data-theme="light"] input[type="time"],
html[data-theme="light"] input[type="datetime-local"]{
    color-scheme:light !important;
    background-color:#fff !important;
    color:#171717 !important;
}

html[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
html[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator,
html[data-theme="light"] input[type="datetime-local"]::-webkit-calendar-picker-indicator{
    opacity:1 !important;
    filter:invert(1) !important;
    background-color:#d1d5db;
    border-radius:6px;
    padding:5px;
    cursor:pointer;
}

@media (prefers-color-scheme: light){
    html[data-theme="system"] input[type="date"],
    html[data-theme="system"] input[type="time"],
    html[data-theme="system"] input[type="datetime-local"]{
        color-scheme:light !important;
        background-color:#fff !important;
        color:#171717 !important;
    }

    html[data-theme="system"] input[type="date"]::-webkit-calendar-picker-indicator,
    html[data-theme="system"] input[type="time"]::-webkit-calendar-picker-indicator,
    html[data-theme="system"] input[type="datetime-local"]::-webkit-calendar-picker-indicator{
        opacity:1 !important;
        filter:invert(1) !important;
        background-color:#d1d5db;
        border-radius:6px;
        padding:5px;
        cursor:pointer;
    }
}
/* Correctif 1.1.3 — sélecteurs visibles et thème */
.picker-field{
    display:grid;
    grid-template-columns:1fr auto;
    gap:8px;
    align-items:center;
}
.picker-field input{
    min-width:0;
}
.picker-btn{
    width:44px;
    height:42px;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--panel);
    color:var(--text);
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size:1.1rem;
}
.picker-btn:hover{
    background:var(--bg);
}
html[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
html[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator,
html[data-theme="light"] input[type="datetime-local"]::-webkit-calendar-picker-indicator{
    filter:none !important;
    opacity:1 !important;
}
/* Correctif 1.1.4b — matières et thème */
.subject-row .btn{
    width:auto !important;
    min-width:105px;
    justify-self:end;
}
.subject-row > span:last-of-type{
    min-width:0;
}
html[data-theme="light"]{
    color-scheme:light !important;
}
html[data-theme="dark"]{
    color-scheme:dark !important;
}
/* Correctif 1.1.5 — sélecteur unique + sombre plus clair */
.picker-field input[type="date"]::-webkit-calendar-picker-indicator,
.picker-field input[type="time"]::-webkit-calendar-picker-indicator,
.picker-field input[type="datetime-local"]::-webkit-calendar-picker-indicator{
    opacity:0 !important;
    display:none !important;
    pointer-events:none !important;
}

/* Firefox / navigateurs sans pseudo-élément : on garde le champ natif utilisable,
   mais seul le bouton explicite est visuellement mis en avant. */
.picker-field input{
    padding-right:12px;
}

/* Mode sombre légèrement éclairci */
html[data-theme="dark"]{
    --bg:#15181d !important;
    --panel:#20242b !important;
    --text:#f3f4f6 !important;
    --muted:#aeb4bd !important;
    --border:#343a44 !important;
    --accent:#f3f4f6 !important;
    --danger:#f87171 !important;
    --today:#2a3140 !important;
}

@media (prefers-color-scheme: dark){
    html[data-theme="system"]{
        --bg:#15181d !important;
        --panel:#20242b !important;
        --text:#f3f4f6 !important;
        --muted:#aeb4bd !important;
        --border:#343a44 !important;
        --accent:#f3f4f6 !important;
        --danger:#f87171 !important;
        --today:#2a3140 !important;
    }
}

/* Cartes de tâches un peu moins sombres */
html[data-theme="dark"] .status-todo{
    background:rgba(245,158,11,.14);
}
html[data-theme="dark"] .status-in_progress{
    background:rgba(59,130,246,.16);
}
html[data-theme="dark"] .status-done{
    background:rgba(34,197,94,.15);
}
html[data-theme="dark"] .status-postponed{
    background:rgba(168,85,247,.15);
}
html[data-theme="dark"] .status-overdue{
    background:rgba(239,68,68,.15);
}
/* Correctif 1.1.6 — lignes de tâches cliquables */
.task-row[data-edit-url]{
    cursor:pointer;
}
.task-row[data-edit-url]:hover td{
    filter:brightness(1.06);
}
.task-row .actions{
    width:1%;
    white-space:nowrap;
    text-align:right;
}
.task-row .actions form{
    margin:0;
}
.task-row .actions .link-danger{
    padding:6px 8px;
}
/* Correctif 1.1.7 — colonne Supprimer compacte */
.task-row .actions{
    width:90px !important;
    min-width:90px !important;
    padding-left:8px !important;
    padding-right:8px !important;
    text-align:center !important;
    vertical-align:middle !important;
    background:transparent !important;
}
.task-row .actions form{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    margin:0 !important;
    width:100% !important;
}
.task-row .actions .link-danger{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:auto !important;
    padding:4px 6px !important;
    line-height:1.2 !important;
    background:transparent !important;
    border:0 !important;
    white-space:nowrap !important;
}
.task-row .actions .link-danger:hover{
    text-decoration:underline;
}
/* Correctif 1.1.8 — tableau des tâches : statut lisible + action compacte */

/*
 * La dernière colonne doit prendre uniquement la largeur nécessaire
 * à "Supprimer", sans absorber l'espace libre du tableau.
 */
.task-row td.actions,
table thead th:last-child{
    width:1% !important;
    min-width:0 !important;
    white-space:nowrap !important;
}

.task-row td.actions{
    padding-left:8px !important;
    padding-right:8px !important;
    text-align:center !important;
    vertical-align:middle !important;
}

.task-row td.actions form{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:auto !important;
    margin:0 !important;
}

.task-row td.actions .link-danger{
    display:inline-flex !important;
    width:auto !important;
    min-width:0 !important;
    padding:4px 6px !important;
    margin:0 !important;
    align-items:center !important;
    justify-content:center !important;
    white-space:nowrap !important;
    line-height:1.2 !important;
    background:transparent !important;
    border:0 !important;
}

/*
 * Le sélecteur de statut ne doit jamais se réduire au point de
 * masquer le libellé sur téléphone.
 */
.task-row .status-form{
    display:block !important;
    width:132px !important;
    min-width:132px !important;
    margin:0 !important;
}

.task-row .status-form select{
    display:block !important;
    width:132px !important;
    min-width:132px !important;
    max-width:none !important;
    padding:9px 30px 9px 10px !important;
    white-space:nowrap !important;
    text-overflow:clip !important;
}

/* Sur petits écrans le tableau reste défilable horizontalement,
   mais chaque colonne conserve une largeur exploitable. */
@media (max-width:800px){
    .table-wrap{
        overflow-x:auto !important;
        -webkit-overflow-scrolling:touch;
    }

    .task-row .status-form,
    .task-row .status-form select{
        width:128px !important;
        min-width:128px !important;
    }

    .task-row td.actions{
        width:1% !important;
        padding-left:6px !important;
        padding-right:6px !important;
    }
}
/* Mise à jour 1.1.9 — emploi du temps hebdomadaire sur l'accueil */
.dashboard-timetable{
    margin-top:16px;
}

.dashboard-timetable-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    margin-bottom:14px;
}

.dashboard-timetable-head h2{
    margin-bottom:4px;
}

.week-timetable{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:10px;
}

.week-day{
    min-width:0;
    border:1px solid var(--border);
    border-radius:12px;
    padding:10px;
    background:var(--bg);
}

.week-day.today{
    background:var(--today);
    border:2px solid var(--accent);
}

.week-day > header{
    display:flex;
    justify-content:space-between;
    gap:8px;
    align-items:baseline;
    padding-bottom:8px;
    margin-bottom:8px;
    border-bottom:1px solid var(--border);
}

.week-day > header span{
    color:var(--muted);
    font-size:.82rem;
}

.week-courses{
    display:grid;
    gap:7px;
}

.week-course{
    display:grid;
    gap:2px;
    padding:7px 8px;
    border-left:4px solid var(--course-color,#64748b);
    border-radius:8px;
    background:var(--panel);
    min-width:0;
}

.week-course strong{
    font-size:.78rem;
    font-variant-numeric:tabular-nums;
}

.week-course span{
    font-size:.9rem;
    overflow-wrap:anywhere;
}

.week-course small{
    color:var(--muted);
}

.week-empty{
    margin:6px 0 0;
    font-size:.88rem;
}

@media(max-width:1100px){
    .week-timetable{
        grid-template-columns:repeat(3,minmax(0,1fr));
    }
}

@media(max-width:800px){
    .dashboard-timetable{
        padding:16px;
    }

    .week-timetable{
        display:grid;
        grid-template-columns:1fr;
        gap:8px;
    }

    .week-day{
        padding:10px 12px;
    }

    .week-day > header{
        margin-bottom:6px;
    }

    .week-course{
        grid-template-columns:92px minmax(0,1fr) auto;
        align-items:center;
        gap:8px;
    }

    .week-course strong,
    .week-course span,
    .week-course small{
        min-width:0;
    }
}

@media(max-width:430px){
    .week-course{
        grid-template-columns:84px minmax(0,1fr);
    }

    .week-course small{
        grid-column:2;
    }
}
/* V2.0.0 — Statistiques */
.stats-filter-card{
    margin-bottom:16px;
}
.stats-filters{
    display:grid;
    gap:12px;
}
.stats-range-buttons{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}
.stats-range-buttons .btn{
    width:auto;
}
.stats-custom-range{
    display:flex;
    flex-wrap:wrap;
    align-items:end;
    gap:10px;
}
.stats-custom-range label{
    min-width:160px;
}
.stats-period{
    margin:12px 0 0;
}
.stats-kpis{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:14px;
    margin-bottom:16px;
}
.stats-kpi{
    display:grid;
    align-content:start;
    gap:5px;
}
.stats-kpi-label{
    color:var(--muted);
    font-size:.88rem;
    font-weight:650;
}
.stats-kpi strong{
    font-size:clamp(1.7rem,3vw,2.35rem);
    line-height:1.05;
}
.stats-kpi small{
    color:var(--muted);
}
.stats-kpi-warning{
    border-color:color-mix(in srgb,var(--danger) 45%,var(--border));
}
.stats-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px;
    margin-bottom:16px;
}
.stats-status-list{
    display:grid;
    gap:14px;
}
.stats-status-row{
    display:grid;
    gap:6px;
}
.stats-status-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}
.stats-status-head strong small{
    color:var(--muted);
    font-weight:500;
}
.stats-progress,
.stats-inline-progress{
    overflow:hidden;
    border-radius:999px;
    background:var(--bg);
    border:1px solid var(--border);
}
.stats-progress{
    height:11px;
}
.stats-progress > span,
.stats-inline-progress > span{
    display:block;
    height:100%;
    min-width:0;
    border-radius:inherit;
    background:var(--accent);
}
.stats-progress .stats-status-todo{background:#64748b}
.stats-progress .stats-status-in_progress{background:#f59e0b}
.stats-progress .stats-status-done{background:#22c55e}
.stats-progress .stats-status-postponed{background:#8b5cf6}
.stats-progress .stats-status-cancelled{background:#94a3b8}
.stats-quality{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
}
.stats-quality > div{
    display:grid;
    gap:3px;
    padding:12px;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--bg);
}
.stats-quality span{
    color:var(--muted);
    font-size:.85rem;
}
.stats-quality strong{
    font-size:1.18rem;
}
.stats-quality small{
    color:var(--muted);
}
.stats-note{
    margin:12px 0 0;
}
.stats-section-head{
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:start;
}
.stats-section-head h2{
    margin-bottom:3px;
}
.stats-chart-wrap{
    overflow-x:auto;
    padding:8px 2px 4px;
}
.stats-bars{
    display:flex;
    align-items:end;
    gap:5px;
    height:250px;
    min-width:max-content;
    padding-top:28px;
}
.stats-bar-column{
    display:grid;
    grid-template-rows:22px 170px 30px;
    width:42px;
    min-width:42px;
    text-align:center;
    align-items:end;
}
.stats-bar-value{
    color:var(--muted);
    font-size:.67rem;
    white-space:nowrap;
    overflow:visible;
}
.stats-bar-track{
    width:24px;
    height:170px;
    margin:auto;
    display:flex;
    align-items:end;
    overflow:hidden;
    border-radius:7px 7px 4px 4px;
    background:var(--bg);
    border:1px solid var(--border);
}
.stats-bar-track span{
    display:block;
    width:100%;
    background:var(--accent);
    border-radius:6px 6px 2px 2px;
}
.stats-bar-label{
    padding-top:6px;
    color:var(--muted);
    font-size:.7rem;
    white-space:nowrap;
}
.stats-subject-table td{
    vertical-align:middle;
}
.stats-inline-progress{
    width:100px;
    height:7px;
    display:inline-block;
    vertical-align:middle;
    margin-right:6px;
}
.stats-subject-table small{
    color:var(--muted);
    white-space:nowrap;
}
.stats-coming{
    margin-top:16px;
}

@media(max-width:1100px){
    .stats-kpis{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media(max-width:800px){
    .stats-grid{
        grid-template-columns:1fr;
    }
    .stats-kpis{
        grid-template-columns:1fr 1fr;
        gap:10px;
    }
    .stats-custom-range{
        display:grid;
        grid-template-columns:1fr 1fr;
    }
    .stats-custom-range .btn{
        grid-column:1/-1;
    }
}

@media(max-width:520px){
    .stats-kpis{
        grid-template-columns:1fr;
    }
    .stats-range-buttons{
        display:grid;
        grid-template-columns:1fr 1fr;
    }
    .stats-range-buttons .btn{
        width:100%;
        text-align:center;
    }
    .stats-custom-range{
        grid-template-columns:1fr;
    }
    .stats-custom-range .btn{
        grid-column:auto;
    }
    .stats-quality{
        grid-template-columns:1fr;
    }
}
/* V2.1.0 — Chronomètre */
.timer-picker-card{
    margin-bottom:16px;
}
.timer-task-picker{
    display:flex;
    align-items:end;
    gap:10px;
}
.timer-task-picker label{
    width:min(680px,100%);
}
.timer-card{
    display:grid;
    gap:20px;
}
.timer-task-title{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:12px;
}
.timer-task-title h2{
    margin:2px 0 0;
}
.timer-task-title p{
    margin:0;
}
.timer-state{
    display:inline-flex;
    align-items:center;
    padding:6px 10px;
    border:1px solid var(--border);
    border-radius:999px;
    white-space:nowrap;
    font-size:.82rem;
    font-weight:700;
}
.timer-state.running{
    background:rgba(34,197,94,.12);
}
.timer-state.paused{
    background:var(--bg);
}
.timer-display{
    padding:24px 12px;
    border:1px solid var(--border);
    border-radius:14px;
    background:var(--bg);
    text-align:center;
    font-size:clamp(2.2rem,8vw,4.8rem);
    font-weight:800;
    line-height:1;
    font-variant-numeric:tabular-nums;
    letter-spacing:-.03em;
}
.timer-comparison{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:10px;
}
.timer-comparison > div{
    display:grid;
    gap:4px;
    padding:12px;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--bg);
}
.timer-comparison span{
    color:var(--muted);
    font-size:.82rem;
}
.timer-comparison strong{
    font-size:1.05rem;
}
.timer-comparison .over{
    color:var(--danger);
}
.timer-comparison .under{
    color:#16a34a;
}
.timer-actions{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}
.timer-actions form{
    margin:0;
}
.timer-active-other{
    margin-bottom:16px;
}
.timer-history td,
.timer-history th{
    white-space:nowrap;
}

@media(max-width:600px){
    .timer-task-picker{
        display:grid;
    }
    .timer-comparison{
        grid-template-columns:1fr;
    }
    .timer-actions{
        display:grid;
        grid-template-columns:1fr 1fr;
    }
    .timer-actions form,
    .timer-actions .btn{
        width:100%;
    }
}
/* V2.2.0 — statistiques temps réel */
.stats-over{
    color:var(--danger);
}
.stats-under{
    color:#16a34a;
}
.stats-chart-legend{
    display:flex;
    gap:18px;
    flex-wrap:wrap;
    margin-bottom:8px;
    color:var(--muted);
    font-size:.85rem;
}
.stats-chart-legend span{
    display:inline-flex;
    gap:7px;
    align-items:center;
}
.stats-chart-legend i{
    width:12px;
    height:12px;
    border-radius:3px;
    display:inline-block;
}
.stats-legend-planned,
.stats-bar-planned{
    background:var(--accent);
}
.stats-legend-actual,
.stats-bar-actual{
    background:#16a34a;
}
.stats-double-track{
    width:32px;
    height:170px;
    margin:auto;
    display:flex;
    align-items:end;
    gap:3px;
}
.stats-double-track > span{
    display:block;
    width:14px;
    min-height:0;
    border-radius:5px 5px 2px 2px;
}
.stats-bar-column-double{
    width:48px;
    min-width:48px;
}
/* V2.3.0 — Planification automatique déterministe */
.planner-intro{
    margin-bottom:16px;
}
.planner-intro p:last-child{
    margin-bottom:0;
}
.planner-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px;
    margin-bottom:16px;
}
.planner-ready dl{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    margin:0;
}
.planner-ready dl > div{
    display:grid;
    gap:4px;
    padding:12px;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--bg);
}
.planner-ready dt{
    color:var(--muted);
    font-size:.84rem;
}
.planner-ready dd{
    margin:0;
    font-size:1.35rem;
    font-weight:750;
}
.planner-generate{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
}
.planner-generate h2{
    margin-bottom:4px;
}
.planner-generate p{
    margin:0;
}
.planner-proposal{
    margin-top:16px;
}
.planner-proposal-head{
    display:flex;
    justify-content:space-between;
    gap:12px;
}
.planner-table td{
    vertical-align:top;
}
.planner-table td:first-child{
    min-width:180px;
}
.planner-table td:first-child small{
    display:block;
    margin-top:3px;
    color:var(--muted);
}
.planner-table td:nth-child(3){
    white-space:nowrap;
}
.planner-table td:nth-child(3) strong{
    display:block;
}
.planner-proposal-actions{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:14px;
}
.planner-proposal-actions form{
    margin:0;
}
.planner-unplanned{
    display:grid;
    gap:8px;
}
.planner-unplanned > div{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:4px 12px;
    padding:10px 12px;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--bg);
}
.planner-unplanned small{
    grid-column:1/-1;
    color:var(--muted);
}
.planner-rules{
    margin-top:16px;
}
.planner-rules li+li{
    margin-top:5px;
}

@media(max-width:800px){
    .planner-grid{
        grid-template-columns:1fr;
    }
    .planner-generate{
        display:grid;
    }
    .planner-generate .btn{
        width:100%;
    }
    .planner-proposal-actions{
        display:grid;
        grid-template-columns:1fr 1fr;
    }
    .planner-proposal-actions form,
    .planner-proposal-actions .btn{
        width:100%;
    }
}

@media(max-width:520px){
    .planner-ready dl{
        grid-template-columns:1fr;
    }
    .planner-proposal-actions{
        grid-template-columns:1fr;
    }
}
/* V2.3.1 — état actif global des boutons */
.btn.is-active,
.btn.active,
.btn[aria-pressed="true"],
.btn[aria-current="page"]{
    background:var(--text) !important;
    color:var(--bg) !important;
    border-color:var(--text) !important;
}

.btn.is-active:hover,
.btn.active:hover,
.btn[aria-pressed="true"]:hover,
.btn[aria-current="page"]:hover{
    filter:brightness(.96);
}

/*
 * Tous les contrôles qui représentent un choix actif peuvent désormais
 * utiliser .is-active, aria-pressed="true" ou aria-current="page".
 * La règle est globale pour toute l'application.
 */

/* Disponibilités / exceptions */
.availability-add-form{
    display:grid;
    grid-template-columns:1.2fr 1fr 1fr auto;
    gap:10px;
    align-items:end;
    margin:14px 0;
}
.availability-list{
    display:grid;
    gap:8px;
    margin-top:12px;
}
.availability-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding:10px 12px;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--bg);
}
.availability-row > div{
    display:flex;
    flex-wrap:wrap;
    gap:8px 14px;
    align-items:baseline;
}
.availability-row span{
    color:var(--muted);
}
.availability-row form{
    margin:0;
}
.availability-empty{
    margin-top:12px;
}
.exception-add-form{
    display:grid;
    grid-template-columns:1fr 1fr 1fr;
    gap:10px;
    align-items:end;
    margin:14px 0;
}
.exception-check{
    display:flex !important;
    flex-direction:row !important;
    align-items:center;
    gap:8px;
    min-height:44px;
}
.exception-check input{
    width:auto !important;
}
.exception-note{
    grid-column:span 2;
}
.exception-add-form > .btn{
    width:auto;
}
.planner-settings-link{
    display:inline-flex;
    width:auto;
    margin-top:10px;
}

/* Les boutons de filtre actifs restent clairement visibles. */
.stats-range-buttons .btn.is-active{
    box-shadow:0 0 0 1px var(--text);
}

@media(max-width:800px){
    .availability-add-form{
        grid-template-columns:1fr 1fr;
    }
    .availability-add-form label:first-of-type{
        grid-column:1/-1;
    }
    .availability-add-form .btn{
        width:100%;
    }

    .exception-add-form{
        grid-template-columns:1fr 1fr;
    }
    .exception-add-form label:first-of-type,
    .exception-note{
        grid-column:1/-1;
    }
    .exception-add-form > .btn{
        width:100%;
        grid-column:1/-1;
    }
}

@media(max-width:520px){
    .availability-add-form,
    .exception-add-form{
        grid-template-columns:1fr;
    }
    .availability-add-form label:first-of-type,
    .exception-add-form label:first-of-type,
    .exception-note{
        grid-column:auto;
    }
    .availability-row{
        align-items:flex-start;
    }
}
/* V2.4.0 — planification avancée + paysage mobile */
.planner-transition-help{
    margin:12px 0 0;
}
.planner-generate-v240{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(320px,520px);
    gap:18px;
    align-items:end;
}
.planner-mode-form{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
    align-items:end;
}
.planner-mode-form label{
    min-width:0;
}
.planner-mode-form .btn{
    width:auto;
}
.planner-ready dl{
    grid-template-columns:repeat(2,minmax(0,1fr));
}
.planner-table .planner-same-badge{
    display:inline-flex;
    margin-left:6px;
    padding:2px 6px;
    border-radius:999px;
    border:1px solid var(--border);
    color:var(--muted);
    font-size:.72rem;
}
.planner-table tr.planner-unchanged{
    opacity:.72;
}
.planner-table tr.planner-changed td:first-child{
    box-shadow:inset 3px 0 0 var(--accent);
}

/*
 * Téléphone en paysage : le menu et le contenu défilent séparément.
 * Le breakpoint tient compte de la faible hauteur, pas seulement de la largeur.
 */
@media (min-width:801px) and (max-height:700px) and (orientation:landscape){
    html,
    body{
        height:100%;
    }

    body{
        overflow:hidden;
    }

    .shell{
        height:100vh;
        height:100dvh;
        min-height:0;
        overflow:hidden;
    }

    .sidebar{
        position:relative;
        top:auto;
        bottom:auto;
        height:100vh;
        height:100dvh;
        max-height:100vh;
        max-height:100dvh;
        overflow-y:auto !important;
        overflow-x:hidden;
        overscroll-behavior:contain;
        -webkit-overflow-scrolling:touch;
        touch-action:pan-y;
        padding-bottom:20px;
    }

    .sidebar nav{
        padding-bottom:18px;
    }

    .sidebar nav a{
        padding-top:9px;
        padding-bottom:9px;
    }

    .content{
        height:100vh;
        height:100dvh;
        min-height:0;
        overflow-y:auto !important;
        overflow-x:hidden;
        overscroll-behavior:contain;
        -webkit-overflow-scrolling:touch;
        touch-action:pan-y;
    }
}

@media(max-width:900px){
    .planner-generate-v240{
        grid-template-columns:1fr;
    }
    .planner-mode-form{
        grid-template-columns:1fr;
    }
    .planner-mode-form .btn{
        width:100%;
    }
}

@media(max-width:520px){
    .planner-ready dl{
        grid-template-columns:1fr;
    }
}
/* V2.5.0 — création rapide des tâches */
.task-name-preview{
    display:flex;
    flex-wrap:wrap;
    gap:7px;
    align-items:baseline;
    padding:10px 12px;
    border:1px dashed var(--border);
    border-radius:10px;
    background:var(--bg);
}
.task-name-preview span{
    color:var(--muted);
    font-size:.85rem;
}
.task-name-preview strong{
    overflow-wrap:anywhere;
}
.task-row[data-href]{
    cursor:pointer;
}
.task-row[data-href]:focus-visible{
    outline:2px solid var(--accent);
    outline-offset:-2px;
}
/* V2.6.0 — préparation automatique des contrôles */
.exam-prepare-card,
.exam-prepare-proposal{
    margin-top:16px;
}
.exam-prepare-actions{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:14px;
}
.exam-prepare-actions form{
    margin:0;
}
.exam-prepare-actions .btn{
    width:auto;
}
@media(max-width:700px){
    .exam-prepare-actions{
        display:grid;
        grid-template-columns:1fr;
    }
    .exam-prepare-actions form,
    .exam-prepare-actions .btn{
        width:100%;
    }
}
/* V2.6.1 — lisibilité du mode de planification */
.planner-mode-form select{
    width:100%;
    min-width:0;
}
.planner-mode-help{
    grid-column:1/-1;
    margin:2px 0 0;
    line-height:1.45;
}
/* V2.6.2 — contrôle déjà préparé / replanification */
.exam-prepared-badge{
    display:inline-flex;
    align-items:center;
    margin-left:8px;
    padding:4px 8px;
    border:1px solid var(--border);
    border-radius:999px;
    color:var(--muted);
    font-size:.78rem;
    white-space:nowrap;
}
.exam-replan-warning{
    margin:0;
}
@media(max-width:800px){
    .exam-prepared-badge{
        margin:6px 0 0;
    }
}
/* V2.6.3 — version + calendrier scolaire */
.app-version{
    margin-top:8px;
    color:var(--muted);
    font-size:.72rem;
    text-align:center;
    opacity:.7;
}

.school-zone-form{
    display:grid;
    grid-template-columns:1fr 1fr auto;
    gap:10px;
    align-items:end;
    margin:14px 0;
}

.school-calendar-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:18px;
    margin-top:16px;
}

.school-calendar-grid h3{
    margin:0 0 8px;
}

.school-calendar-row{
    display:flex;
    justify-content:space-between;
    gap:12px;
    padding:7px 0;
    border-bottom:1px solid var(--border);
}

.school-calendar-row span{
    color:var(--muted);
    white-space:nowrap;
}

.cal-day.school-break{
    background:
        linear-gradient(
            135deg,
            transparent 0,
            transparent 46%,
            rgba(100,116,139,.08) 46%,
            rgba(100,116,139,.08) 54%,
            transparent 54%,
            transparent 100%
        ),
        var(--bg);
}

.cal-day.public-holiday{
    border-color:#d97706;
}

.cal-event.holiday{
    border-left:4px solid #d97706;
    background:rgba(217,119,6,.10);
    cursor:default;
}

@media(max-width:800px){
    .app-version{
        position:absolute;
        right:5px;
        bottom:1px;
        margin:0;
        font-size:.58rem;
        line-height:1;
        opacity:.55;
        pointer-events:none;
    }

    .school-zone-form,
    .school-calendar-grid{
        grid-template-columns:1fr;
    }

    .school-zone-form .btn{
        width:100%;
    }
}

@media(max-width:520px){
    .school-calendar-row{
        display:grid;
        gap:3px;
    }

    .school-calendar-row span{
        white-space:normal;
    }
}
/* V2.6.4 — editable school calendar */
.calendar-settings-columns{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:24px;
    margin-top:18px;
}

.calendar-settings-columns h3{
    margin:0 0 10px;
}

.calendar-edit-row{
    display:grid;
    grid-template-columns:minmax(160px,1.5fr) minmax(135px,1fr) minmax(135px,1fr) auto;
    gap:8px;
    align-items:center;
    padding:8px 0;
    border-bottom:1px solid var(--border);
}

.holiday-edit-row{
    grid-template-columns:minmax(180px,1.5fr) minmax(135px,1fr) auto;
}

.calendar-add-row{
    display:grid;
    grid-template-columns:minmax(160px,1.5fr) minmax(135px,1fr) minmax(135px,1fr) auto;
    gap:8px;
    align-items:end;
    margin-top:12px;
}

.holiday-add-row{
    grid-template-columns:minmax(180px,1.5fr) minmax(135px,1fr) auto;
}

.calendar-row-actions{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}

.official-restore-form{
    margin-top:10px;
}

@media(max-width:1050px){
    .calendar-settings-columns{
        grid-template-columns:1fr;
    }
}

@media(max-width:700px){
    .calendar-edit-row,
    .holiday-edit-row,
    .calendar-add-row,
    .holiday-add-row{
        grid-template-columns:1fr;
    }
}
/* V2.6.4 — page active dans le menu */
.sidebar nav a.is-active,
.sidebar nav a[aria-current="page"] {
    background: var(--accent);
    color: var(--bg);
    font-weight: 700;
}

.sidebar nav a.is-active:hover,
.sidebar nav a[aria-current="page"]:hover {
    background: var(--accent);
    color: var(--bg);
}
/* ================================================================
   V2.7.0 — Aide intégrée
   ================================================================ */

.help-hero{
    margin-bottom:16px;
}

.help-search-label{
    display:block;
    margin-top:16px;
    margin-bottom:6px;
    font-weight:700;
}

.help-search{
    width:100%;
    max-width:720px;
}

.help-toc{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-bottom:16px;
}

.help-toc a{
    display:inline-flex;
    align-items:center;
    padding:7px 10px;
    border:1px solid var(--border);
    border-radius:999px;
    text-decoration:none;
    color:var(--text);
    background:var(--panel);
}

.help-toc a:hover{
    border-color:var(--accent);
}

.help-section{
    scroll-margin-top:18px;
}

.help-section h2{
    margin-top:0;
}

.help-section h3{
    margin-top:20px;
    margin-bottom:8px;
}

.help-section li{
    margin:5px 0;
}

.help-note,
.help-example{
    margin:14px 0;
    padding:12px 14px;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--today);
}

.help-section[hidden]{
    display:none !important;
}

@media (max-width:700px){
    .help-toc{
        gap:6px;
    }

    .help-toc a{
        padding:6px 9px;
        font-size:.92rem;
    }
}
/* ================================================================
   V2.7.1 — Finitions UX
   ================================================================ */

/* Avertissements uniformisés */
.alert.warning{
    border:2px solid #b7791f;
    background:color-mix(in srgb,#f59e0b 14%,var(--panel));
    color:var(--text);
    font-weight:500;
}

.alert.warning strong{
    display:inline-block;
    margin-bottom:3px;
    font-weight:800;
}

/* Retour en haut — Aide */
.help-back-to-top{
    position:fixed;
    right:22px;
    bottom:22px;
    z-index:50;
    width:46px;
    height:46px;
    border:1px solid var(--border);
    border-radius:50%;
    background:var(--accent);
    color:var(--bg);
    font-size:1.35rem;
    font-weight:800;
    line-height:1;
    cursor:pointer;
    opacity:0;
    visibility:hidden;
    transform:translateY(8px);
    transition:opacity .18s ease,transform .18s ease,visibility .18s;
    box-shadow:0 8px 24px rgba(0,0,0,.18);
}

.help-back-to-top.is-visible{
    opacity:1;
    visibility:visible;
    transform:translateY(0);
}

/* Calendrier horaire */
.cal-timeline-scroll{
    overflow-x:auto;
    overflow-y:visible;
    padding-bottom:8px;
}

.cal-day-timeline,
.cal-week-timeline{
    display:grid;
    align-items:start;
    min-width:720px;
}

.cal-day-timeline{
    grid-template-columns:68px minmax(520px,1fr);
}

.cal-week-timeline{
    grid-template-columns:68px repeat(7,minmax(150px,1fr));
    min-width:1120px;
}

.cal-hour-axis{
    position:relative;
    margin-top:44px;
    height:960px;
    border-right:1px solid var(--border);
}

.cal-hour-mark{
    position:absolute;
    right:8px;
    transform:translateY(-50%);
    font-size:.78rem;
    color:var(--muted);
    white-space:nowrap;
}

.cal-timeline-day{
    min-width:0;
    border-right:1px solid var(--border);
}

.cal-timeline-day-head{
    height:44px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:4px 6px;
    font-weight:700;
    text-transform:capitalize;
    border-bottom:1px solid var(--border);
    background:var(--panel);
    position:sticky;
    top:0;
    z-index:4;
}

.cal-timeline-body{
    position:relative;
    min-height:960px;
    background:
        linear-gradient(
            to bottom,
            transparent 63px,
            var(--border) 64px
        );
    background-size:100% 64px;
}

.cal-hour-line{
    position:absolute;
    left:0;
    right:0;
    border-top:1px solid var(--border);
    pointer-events:none;
}

.cal-hour-event{
    position:absolute;
    left:4px;
    right:4px;
    z-index:2;
    overflow:hidden;
    box-sizing:border-box;
    margin:0;
}

.cal-all-day{
    padding:6px;
    border-bottom:1px solid var(--border);
    background:var(--panel);
}

.cal-all-day > strong{
    display:block;
    margin-bottom:5px;
    font-size:.78rem;
    color:var(--muted);
}

.cal-all-day-items{
    display:flex;
    flex-direction:column;
    gap:4px;
}

@media (max-width:700px){
    .help-back-to-top{
        right:14px;
        bottom:14px;
        width:44px;
        height:44px;
    }

    .cal-day-timeline{
        min-width:640px;
    }

    .cal-week-timeline{
        min-width:1080px;
    }
}
/* ================================================================
   V2.7.2 — Démarrer une tâche
   ================================================================ */

.task-work-actions{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    align-items:center;
}

.task-work-actions form{
    margin:0;
}

.task-work-btn{
    padding:6px 9px;
    font-size:.84rem;
    white-space:nowrap;
}

.task-start-tip{
    border-left:4px solid var(--accent);
    font-size:1rem;
}

.exam-row,
.task-row{
    cursor:pointer;
}

@media(max-width:700px){
    .task-work-actions{
        min-width:150px;
    }

    .task-work-btn{
        width:100%;
    }
}
/* ================================================================
   V2.7.2b — Actions de tâches
   ================================================================ */

.task-row-actions{
    min-width:280px;
}

.task-row-actions-inner{
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
}

.task-row-actions-inner form{
    margin:0;
}

.task-action-btn{
    min-height:36px;
    padding:7px 12px;
    border-radius:9px;
    white-space:nowrap;
    display:inline-flex;
    align-items:center;
    justify-content:center;
}

.btn.danger{
    border-color:color-mix(in srgb,var(--danger) 70%,var(--border));
    color:var(--danger);
    background:transparent;
}

.btn.danger:hover{
    background:color-mix(in srgb,var(--danger) 12%,var(--panel));
}

.task-state-badge{
    display:inline-flex;
    align-items:center;
    min-height:36px;
}

@media(max-width:900px){
    .task-row-actions{
        min-width:240px;
    }

    .task-row-actions-inner{
        gap:10px;
    }
}

@media(max-width:700px){
    .task-row-actions{
        min-width:220px;
    }

    .task-row-actions-inner{
        flex-direction:row;
        align-items:stretch;
    }

    .task-action-btn{
        min-width:96px;
    }
}
/* ================================================================
   V2.7.2c — suivi du temps intégré
   ================================================================ */

.task-timer-panel{
    margin-bottom:16px;
}

.task-timer-head{
    display:flex;
    justify-content:space-between;
    gap:18px;
    align-items:flex-start;
}

.task-timer-head h2{
    margin:2px 0 4px;
}

.task-timer-display{
    margin:18px 0;
    font-size:clamp(2.2rem,6vw,4.4rem);
    line-height:1;
    font-weight:800;
    letter-spacing:.02em;
    font-variant-numeric:tabular-nums;
}

.task-timer-metrics{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
    margin-bottom:16px;
}

.task-timer-metrics > div{
    padding:12px;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--today);
}

.task-timer-metrics span{
    display:block;
    color:var(--muted);
    font-size:.85rem;
    margin-bottom:4px;
}

.task-timer-metrics strong{
    display:block;
    font-variant-numeric:tabular-nums;
}

.task-timer-metrics .over{
    color:var(--danger);
}

.task-timer-actions{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.task-timer-actions form{
    margin:0;
}

@media(max-width:700px){
    .task-timer-head{
        flex-direction:column;
        gap:8px;
    }

    .task-timer-metrics{
        grid-template-columns:1fr;
    }

    .task-timer-actions .btn{
        width:100%;
    }

    .task-timer-actions form{
        flex:1 1 140px;
    }
}
/* ================================================================
   V2.7.2d — conflit dynamique entre tâches
   ================================================================ */

.task-overlap-warning{
    margin:14px 0 18px;
}

.task-overlap-warning p{
    margin:6px 0 0;
}

.task-overlap-actions{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:10px;
    margin-top:12px;
}

.task-overlap-actions form{
    margin:0;
}

@media(max-width:700px){
    .task-overlap-actions{
        flex-direction:column;
        align-items:stretch;
    }

    .task-overlap-actions form,
    .task-overlap-actions .btn{
        width:100%;
    }
}\n/* ================================================================\n   V2.7.2f — calendrier jour/semaine et mobile\n   ================================================================ */\n.cal-week-scroll,.cal-day-scroll{width:100%;overflow:auto;overscroll-behavior:contain;border:1px solid var(--border);border-radius:12px;background:var(--panel)}\n.cal-week-timeline-grid{display:grid;grid-template-columns:64px repeat(7,minmax(150px,1fr));min-width:1114px;align-items:start;position:relative}\n.cal-day-timeline-grid{display:grid;grid-template-columns:64px minmax(0,1fr);min-width:520px;align-items:start;position:relative}\n.cal-sticky-corner,.cal-timeline-day-head{position:sticky;top:0;z-index:25;min-height:54px;box-sizing:border-box;background:var(--panel);border-bottom:1px solid var(--border)}\n.cal-sticky-corner{left:0;z-index:35;display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:.78rem;border-right:1px solid var(--border)}\n.cal-timeline-day-head{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:7px 4px;text-transform:capitalize;border-right:1px solid var(--border)}\n.cal-timeline-day-head span{color:var(--muted);font-size:.78rem}.cal-timeline-day-head.today{background:var(--today);box-shadow:inset 0 -3px 0 var(--accent)}\n.cal-timeline-day-head.school-break,.cal-timeline-day-head.public-holiday{background:var(--today)}\n.cal-all-day-label{position:sticky;left:0;z-index:18;min-height:42px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;padding:5px;color:var(--muted);font-size:.72rem;background:var(--panel);border-right:1px solid var(--border);border-bottom:1px solid var(--border)}\n.cal-all-day-cell{min-height:42px;box-sizing:border-box;padding:4px;border-right:1px solid var(--border);border-bottom:1px solid var(--border);background:var(--panel)}\n.cal-all-day-event{display:block;padding:5px 7px;border-radius:7px;font-size:.76rem;line-height:1.25;font-weight:700;overflow-wrap:anywhere}.cal-all-day-event.school-break{background:var(--today);border:1px solid var(--accent)}.cal-all-day-event.public-holiday{background:var(--today);border:1px solid var(--border)}\n.cal-hours-column{position:sticky;left:0;z-index:16;background:var(--panel);border-right:1px solid var(--border)}.cal-hour-label{position:absolute;left:0;right:0;text-align:center;color:var(--muted);font-size:.72rem;font-variant-numeric:tabular-nums}\n.cal-timeline-lane{position:relative;min-width:0;border-right:1px solid var(--border);background:var(--panel)}.cal-timeline-lane.today,.cal-timeline-lane.school-break,.cal-timeline-lane.public-holiday{background:var(--today)}\n.cal-hour-line{position:absolute;left:0;right:0;height:1px;background:var(--border);pointer-events:none}.cal-timed-event{position:absolute;left:4px;right:4px;margin:0!important;overflow:hidden;z-index:5;box-sizing:border-box;padding:5px 6px;font-size:.76rem;line-height:1.2}.cal-timeline-lane.drag-over{outline:2px solid var(--accent);outline-offset:-2px}\n@media(max-width:800px){.calendar-toolbar{position:sticky;top:0;z-index:38;background:var(--panel);padding:6px 0}.cal-week-scroll,.cal-day-scroll{max-height:calc(100vh - 210px);-webkit-overflow-scrolling:touch}.cal-week-timeline-grid{grid-template-columns:54px repeat(7,132px);min-width:978px}.cal-day-timeline-grid{grid-template-columns:54px minmax(250px,1fr);min-width:304px}.cal-sticky-corner,.cal-timeline-day-head{min-height:50px}.cal-timeline-day-head{font-size:.84rem}.cal-all-day-event{font-size:.7rem;padding:4px 5px}.cal-timed-event{font-size:.72rem;left:3px;right:3px;padding:4px 5px}}\n@media(max-width:520px){.cal-week-timeline-grid{grid-template-columns:50px repeat(7,118px);min-width:876px}.cal-day-timeline-grid{grid-template-columns:50px minmax(230px,1fr);min-width:280px}}\n
/* ================================================================
   V2.7.2g2 — grille calendrier robuste
   ================================================================ */

#calendar .cal-week-scroll,
#calendar .cal-day-scroll{
    width:100% !important;
    display:block !important;
    position:relative !important;
    overflow:auto !important;
    overscroll-behavior:contain;
    border:1px solid var(--border);
    border-radius:12px;
    background:var(--panel);
}

#calendar .cal-week-timeline-grid{
    display:grid !important;
    grid-template-columns:64px repeat(7,minmax(150px,1fr)) !important;
    grid-template-rows:auto auto auto !important;
    min-width:1114px !important;
    position:relative !important;
    align-items:start !important;
}

#calendar .cal-day-timeline-grid{
    display:grid !important;
    grid-template-columns:64px minmax(300px,1fr) !important;
    grid-template-rows:auto auto auto !important;
    min-width:364px !important;
    position:relative !important;
    align-items:start !important;
}

#calendar .cal-sticky-corner,
#calendar .cal-timeline-day-head{
    position:sticky !important;
    top:0 !important;
    min-height:52px;
    box-sizing:border-box;
    background:var(--panel);
    border-bottom:1px solid var(--border);
}

#calendar .cal-sticky-corner{
    left:0 !important;
    z-index:40 !important;
    display:flex;
    align-items:center;
    justify-content:center;
    border-right:1px solid var(--border);
    color:var(--muted);
    font-size:.76rem;
}

#calendar .cal-timeline-day-head{
    z-index:30 !important;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:2px;
    padding:6px 4px;
    border-right:1px solid var(--border);
}

#calendar .cal-timeline-day-head span{
    color:var(--muted);
    font-size:.76rem;
}

#calendar .cal-timeline-day-head.today{
    background:var(--today);
    box-shadow:inset 0 -3px 0 var(--accent);
}

#calendar .cal-all-day-label{
    position:sticky !important;
    left:0 !important;
    z-index:22 !important;
    min-height:42px;
    display:flex;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
    background:var(--panel);
    border-right:1px solid var(--border);
    border-bottom:1px solid var(--border);
    color:var(--muted);
    font-size:.72rem;
}

#calendar .cal-all-day-cell{
    position:relative !important;
    min-height:42px;
    box-sizing:border-box;
    padding:4px;
    border-right:1px solid var(--border);
    border-bottom:1px solid var(--border);
    background:var(--panel);
}

#calendar .cal-all-day-event{
    display:block;
    padding:5px 7px;
    border-radius:7px;
    font-size:.76rem;
    line-height:1.25;
    font-weight:700;
    overflow-wrap:anywhere;
}

#calendar .cal-all-day-event.school-break{
    background:var(--today);
    border:1px solid var(--accent);
}

#calendar .cal-all-day-event.public-holiday{
    background:var(--today);
    border:1px solid var(--border);
}

#calendar .cal-hours-column{
    position:sticky !important;
    left:0 !important;
    z-index:20 !important;
    margin:0 !important;
    transform:none !important;
    background:var(--panel);
    border-right:1px solid var(--border);
}

#calendar .cal-hour-label{
    position:absolute !important;
    left:0 !important;
    right:0 !important;
    width:auto !important;
    text-align:center;
    color:var(--muted);
    font-size:.72rem;
    font-variant-numeric:tabular-nums;
    transform:none !important;
}

#calendar .cal-timeline-lane{
    position:relative !important;
    margin:0 !important;
    transform:none !important;
    min-width:0;
    border-right:1px solid var(--border);
    background:var(--panel);
}

#calendar .cal-timeline-lane.today,
#calendar .cal-timeline-lane.school-break,
#calendar .cal-timeline-lane.public-holiday{
    background:var(--today);
}

#calendar .cal-hour-line{
    position:absolute;
    left:0;
    right:0;
    height:1px;
    background:var(--border);
    pointer-events:none;
}

#calendar .cal-timed-event{
    position:absolute !important;
    left:4px !important;
    right:4px !important;
    margin:0 !important;
    overflow:hidden;
    z-index:5;
    box-sizing:border-box;
    padding:5px 6px;
    font-size:.76rem;
    line-height:1.2;
}

@media(max-width:800px){
    #calendar .cal-week-scroll,
    #calendar .cal-day-scroll{
        max-height:calc(100vh - 210px);
        -webkit-overflow-scrolling:touch;
    }

    #calendar .cal-week-timeline-grid{
        grid-template-columns:54px repeat(7,132px) !important;
        min-width:978px !important;
    }

    #calendar .cal-day-timeline-grid{
        grid-template-columns:54px minmax(250px,1fr) !important;
        min-width:304px !important;
    }
}

@media(max-width:520px){
    #calendar .cal-week-timeline-grid{
        grid-template-columns:50px repeat(7,118px) !important;
        min-width:876px !important;
    }

    #calendar .cal-day-timeline-grid{
        grid-template-columns:50px minmax(230px,1fr) !important;
        min-width:280px !important;
    }
}
/* ================================================================
   V2.7.2h — navigation et calendrier mobile
   ================================================================ */

.mobile-bottom-nav,
.mobile-more-panel,
.mobile-more-backdrop{
    display:none;
}

@media(max-width:800px){

    html,
    body{
        max-width:100%;
        overflow-x:hidden !important;
    }

    body{
        padding-bottom:72px;
    }

    .shell{
        display:block !important;
        width:100% !important;
        max-width:100% !important;
        overflow-x:hidden !important;
    }

    .sidebar{
        display:none !important;
    }

    .content{
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        padding:14px 12px 82px !important;
        overflow-x:hidden !important;
    }

    .topbar{
        width:100%;
        min-width:0;
        gap:10px;
        align-items:center !important;
    }

    .topbar h1{
        min-width:0;
        font-size:1.45rem;
    }

    .topbar .btn{
        flex:0 0 auto;
    }

    .card{
        min-width:0 !important;
        max-width:100% !important;
    }

    /* ---------- Barre basse ---------- */

    .mobile-bottom-nav{
        position:fixed;
        left:0;
        right:0;
        bottom:0;
        z-index:1000;
        display:grid;
        grid-template-columns:repeat(5,minmax(0,1fr));
        gap:2px;
        padding:6px max(5px,env(safe-area-inset-right))
                calc(6px + env(safe-area-inset-bottom))
                max(5px,env(safe-area-inset-left));
        background:var(--panel);
        border-top:1px solid var(--border);
        box-shadow:0 -4px 18px rgba(0,0,0,.10);
    }

    .mobile-bottom-nav a,
    .mobile-bottom-nav button{
        min-width:0;
        min-height:46px;
        border:0;
        border-radius:10px;
        padding:6px 3px;
        background:transparent;
        color:var(--text);
        font:inherit;
        font-size:.70rem;
        line-height:1.1;
        text-align:center;
        display:flex;
        align-items:center;
        justify-content:center;
        cursor:pointer;
    }

    .mobile-bottom-nav a.is-active,
    .mobile-bottom-nav button.is-active{
        background:var(--accent);
        color:var(--bg);
        font-weight:700;
    }

    .mobile-more-backdrop{
        position:fixed;
        inset:0;
        z-index:1005;
        display:block;
        background:rgba(0,0,0,.42);
    }

    .mobile-more-backdrop[hidden]{
        display:none !important;
    }

    .mobile-more-panel{
        position:fixed;
        left:10px;
        right:10px;
        bottom:calc(68px + env(safe-area-inset-bottom));
        z-index:1010;
        display:block;
        max-height:min(70vh,520px);
        overflow:auto;
        padding:14px;
        border:1px solid var(--border);
        border-radius:16px;
        background:var(--panel);
        box-shadow:0 12px 38px rgba(0,0,0,.28);
    }

    .mobile-more-panel[hidden]{
        display:none !important;
    }

    .mobile-more-head{
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:12px;
        margin-bottom:10px;
    }

    .mobile-more-close{
        border:1px solid var(--border);
        border-radius:9px;
        padding:7px 10px;
        background:transparent;
        color:var(--text);
    }

    .mobile-more-links{
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:8px;
    }

    .mobile-more-links a{
        display:flex;
        min-height:44px;
        align-items:center;
        padding:10px 12px;
        border:1px solid var(--border);
        border-radius:10px;
        background:var(--bg);
    }

    .mobile-more-links a.is-active{
        border-color:var(--accent);
        font-weight:700;
    }

    body.mobile-more-open{
        overflow:hidden;
    }

    /* ---------- Calendrier ---------- */

    #calendar{
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        overflow:visible !important;
    }

    #calendar > h2{
        max-width:100%;
        overflow:hidden;
        text-overflow:ellipsis;
    }

    .calendar-toolbar{
        width:100%;
        max-width:100%;
        display:grid !important;
        grid-template-columns:auto 1fr auto;
        gap:8px !important;
        align-items:center;
        position:relative !important;
        top:auto !important;
        z-index:auto !important;
        padding:0 !important;
        background:transparent !important;
    }

    .calendar-toolbar #todayBtn{
        width:100%;
    }

    .calendar-toolbar #viewSelect{
        grid-column:1/-1;
        width:100%;
    }

    #calendar .cal-week-scroll,
    #calendar .cal-day-scroll{
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        height:calc(100dvh - 285px) !important;
        min-height:360px;
        max-height:none !important;
        overflow:auto !important;
        overscroll-behavior:contain;
        -webkit-overflow-scrolling:touch;
        border-radius:10px;
        position:relative !important;
    }

    #calendar .cal-week-timeline-grid{
        display:grid !important;
        grid-template-columns:48px repeat(7,132px) !important;
        grid-template-rows:auto auto auto !important;
        min-width:972px !important;
        width:972px !important;
        max-width:none !important;
    }

    #calendar .cal-day-timeline-grid{
        display:grid !important;
        grid-template-columns:48px minmax(250px,1fr) !important;
        grid-template-rows:auto auto auto !important;
        min-width:298px !important;
        width:100% !important;
    }

    #calendar .cal-sticky-corner,
    #calendar .cal-timeline-day-head{
        position:sticky !important;
        top:0 !important;
        z-index:45 !important;
        background:var(--panel) !important;
    }

    #calendar .cal-sticky-corner{
        left:0 !important;
        z-index:60 !important;
    }

    #calendar .cal-timeline-day-head.today{
        background:var(--today) !important;
    }

    #calendar .cal-all-day-label{
        position:sticky !important;
        left:0 !important;
        z-index:35 !important;
        background:var(--panel) !important;
    }

    #calendar .cal-hours-column{
        position:sticky !important;
        left:0 !important;
        z-index:30 !important;
        background:var(--panel) !important;
    }

    #calendar .cal-timeline-lane{
        min-width:132px !important;
    }

    #calendar .cal-timed-event{
        font-size:.72rem !important;
    }
}

@media(max-width:390px){
    #calendar .cal-week-timeline-grid{
        grid-template-columns:46px repeat(7,124px) !important;
        min-width:914px !important;
        width:914px !important;
    }

    #calendar .cal-timeline-lane{
        min-width:124px !important;
    }

    .mobile-bottom-nav a,
    .mobile-bottom-nav button{
        font-size:.66rem;
    }
}
/* V2.7.2i — version mobile et bouton Top */
.mobile-app-version{margin-top:12px;padding-top:10px;border-top:1px solid var(--border);color:var(--muted);font-size:.76rem;text-align:center}

@media(max-width:800px){
  .mobile-more-button{font-size:1.35rem!important;font-weight:700;line-height:1!important;letter-spacing:.08em}
}
/* ================================================================
   V2.7.2j — identité Planner
   ================================================================ */

.brand{
    display:flex;
    align-items:center;
    min-height:54px;
    padding:8px 10px 12px;
}

.brand-link{
    display:inline-flex;
    align-items:center;
    max-width:100%;
    text-decoration:none;
}

.brand-logo{
    display:block;
    width:auto;
    height:auto;
    max-width:158px;
    max-height:48px;
    object-fit:contain;
}

@media(max-width:1100px) and (min-width:801px){
    .brand-logo{
        max-width:138px;
        max-height:44px;
    }
}

@media(max-width:800px){
    /* Le menu latéral est masqué par la navigation basse mobile. */
    .brand{
        display:none !important;
    }
}

/* Icône discrète sur les écrans de connexion / cartes d'authentification. */
.auth-card::before{
    content:"";
    display:block;
    width:64px;
    height:64px;
    margin:0 auto 12px;
    background:
        url('/assets/img/logo-planner-icon.png')
        center/contain no-repeat;
}

@media(max-width:520px){
    .auth-card::before{
        width:54px;
        height:54px;
        margin-bottom:10px;
    }
}
/* ================================================================
   V2.7.3 — simplification UX
   ================================================================ */

.task-planning-entry{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
}
.task-planning-entry h2{
    margin-bottom:5px;
}
.task-planning-entry p{
    margin-bottom:0;
}

.dashboard-section-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:14px;
    margin-bottom:14px;
}
.dashboard-section-head h2{
    margin-bottom:4px;
}

.dashboard-calendar-frame{
    display:block;
    width:100%;
    height:640px;
    border:0;
    border-radius:12px;
    background:var(--bg);
}

.dashboard-stats-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
}
.dashboard-stats-grid>div{
    border:1px solid var(--border);
    border-radius:12px;
    padding:15px;
}
.dashboard-stats-grid strong,
.dashboard-stats-grid span{
    display:block;
}
.dashboard-stats-grid strong{
    font-size:1.45rem;
    margin-bottom:4px;
}
.dashboard-stats-grid span{
    color:var(--muted);
}

.settings-overview-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    margin:16px 0;
}
.settings-overview-grid>a{
    display:block;
    padding:15px;
    border:1px solid var(--border);
    border-radius:12px;
    background:var(--bg);
    color:var(--text);
    text-decoration:none;
}
.settings-overview-grid>a:hover{
    border-color:var(--accent);
}
.settings-overview-grid strong,
.settings-overview-grid span{
    display:block;
}
.settings-overview-grid span{
    margin-top:4px;
    color:var(--muted);
    font-size:.92rem;
}

.settings-timetable-entry{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-top:16px;
    padding-top:16px;
    border-top:1px solid var(--border);
}
.settings-timetable-entry p{
    margin:4px 0 0;
}

@media(max-width:800px){
    .task-planning-entry,
    .dashboard-section-head,
    .settings-timetable-entry{
        align-items:stretch;
        flex-direction:column;
    }

    .task-planning-entry .btn,
    .dashboard-section-head .btn,
    .settings-timetable-entry .btn{
        width:100%;
        text-align:center;
    }

    .dashboard-calendar-frame{
        height:560px;
    }
}

@media(max-width:560px){
    .dashboard-stats-grid,
    .settings-overview-grid{
        grid-template-columns:1fr;
    }

    .dashboard-calendar-frame{
        height:520px;
    }
}
/* ================================================================
   V2.7.3a — calendrier Accueil
   Le calendrier reste compact sur l'Accueil mais son contenu est
   défilable verticalement à l'intérieur de l'iframe.
   ================================================================ */

.dashboard-calendar-frame{
    height:680px;
    overflow:auto;
    overscroll-behavior:contain;
}

@media(max-width:800px){
    .dashboard-calendar-frame{
        height:600px;
    }
}

@media(max-width:560px){
    .dashboard-calendar-frame{
        height:540px;
    }
}
/* V2.7.3d — navigation mobile auditée */
@media(max-width:820px){
    .mobile-bottom-nav{
        grid-template-columns:repeat(5,minmax(0,1fr)) !important;
    }
    .mobile-bottom-nav a,
    .mobile-bottom-nav button{
        min-width:0;
        white-space:nowrap;
        overflow:hidden;
        text-overflow:ellipsis;
    }
    .mobile-more-panel{
        max-height:min(78vh,620px);
        overflow-y:auto;
        overscroll-behavior:contain;
    }
}
/* ================================================================
   V2.7.3e — proposition contrôles éditable
   ================================================================ */

.exam-prepare-edit-help{
    margin-bottom:12px;
}

.exam-prepare-edit-table input[type="date"],
.exam-prepare-edit-table input[type="time"]{
    width:100%;
    min-width:132px;
    margin:0;
}

.exam-prepare-edit-table td{
    vertical-align:middle;
}

.exam-prepare-edit-form .exam-prepare-actions{
    margin-top:14px;
}

@media(max-width:700px){
    .exam-prepare-edit-table{
        min-width:680px;
    }
}
/* ================================================================
   V2.7.3f — calendrier intégré aplati
   ================================================================ */

.dashboard-calendar-card .dashboard-calendar-frame,
.dashboard-calendar-card iframe{
    display:block;
    width:100%;
    border:0 !important;
    border-radius:0 !important;
    outline:0 !important;
    box-shadow:none !important;
    background:transparent !important;
}

.dashboard-calendar-card{
    overflow:hidden;
}
/* ================================================================
   V2.7.3g — calendrier Accueil simplifié
   On agit uniquement sur l'enveloppe du calendrier intégré.
   ================================================================ */

.dashboard-calendar-card{
    padding-bottom:14px;
}

.dashboard-calendar-card .dashboard-calendar-frame{
    display:block;
    width:100%;
    border:0 !important;
    border-radius:10px !important;
    box-shadow:none !important;
    background:transparent !important;
    margin:0 !important;
}

/*
 * Réduit l'impression de "carte dans la carte" sans supprimer
 * la structure visuelle propre au calendrier.
 */
.dashboard-calendar-card .dashboard-calendar-frame{
    outline:none !important;
}

@media(max-width:700px){
    .dashboard-calendar-card{
        padding-left:12px;
        padding-right:12px;
    }
}
/* ================================================================
   V2.7.3h — enveloppe calendrier propre
   ================================================================ */

/*
 * L'Accueil porte déjà sa propre carte "Calendrier".
 * L'iframe ne doit ajouter ni bordure, ni ombre, ni marge.
 */
.dashboard-calendar-card{
    overflow:hidden;
}

.dashboard-calendar-card .dashboard-calendar-frame{
    display:block;
    width:100%;
    margin:0 !important;
    border:0 !important;
    outline:0 !important;
    box-shadow:none !important;
    border-radius:0 !important;
    background:transparent !important;
}

/*
 * On supprime uniquement l'espace inutile entre l'entête de la carte
 * et l'iframe. Le calendrier interne garde son propre fond et ses propres
 * séparations.
 */
.dashboard-calendar-card .dashboard-section-head{
    margin-bottom:10px;
}

/*
 * Les anciens correctifs f/g peuvent être encore présents plus haut dans
 * le fichier CSS : ces règles finales prennent volontairement priorité.
 */
.dashboard-calendar-card iframe{
    border:0 !important;
    outline:0 !important;
    box-shadow:none !important;
    border-radius:0 !important;
    background:transparent !important;
}
/* ================================================================
   V2.7.4 — rationalisation Planifier
   ================================================================ */

.planner-settings-hidden-v274{
    display:none !important;
}

.planner-settings-link-v274{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
}

.planner-settings-link-v274 h2{
    margin-bottom:4px;
}

.planner-settings-link-v274 p{
    margin-bottom:0;
}

@media(max-width:700px){
    .planner-settings-link-v274{
        flex-direction:column;
        align-items:stretch;
    }

    .planner-settings-link-v274 .btn{
        width:100%;
        text-align:center;
    }
}
/* ================================================================
   V2.7.4a — simplification Tâches
   ================================================================ */

.tasks-filter-card-v274a{
    padding-top:14px;
    padding-bottom:14px;
}

.tasks-quick-filters-v274a{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    align-items:center;
}

.tasks-quick-filter-v274a{
    min-height:38px;
}

.tasks-quick-filter-v274a.active{
    background:var(--accent);
    color:var(--bg);
    border-color:var(--accent);
}

.tasks-advanced-filters-v274a{
    margin-top:12px;
}

.tasks-advanced-filters-v274a>summary{
    cursor:pointer;
    width:max-content;
    font-weight:650;
    color:var(--muted);
    user-select:none;
}

.tasks-advanced-filters-v274a[open]>summary{
    margin-bottom:12px;
}

.tasks-advanced-filters-v274a .filters{
    margin:0;
}

/* Actions groupées : cachées tant qu'il n'y a pas de sélection. */
.task-bulk-context-v274a{
    display:none !important;
}

.task-bulk-context-v274a.is-visible{
    display:flex !important;
    align-items:center;
    gap:8px;
    padding:10px 0 12px;
}

.task-bulk-count-v274a{
    margin-right:auto;
    font-weight:650;
}

/* Planifier reste disponible, mais visuellement secondaire. */
.task-planning-entry-v274a{
    padding-top:14px;
    padding-bottom:14px;
}

.task-planning-entry-v274a h2{
    font-size:1.05rem;
}

/*
 * Sur écrans intermédiaires, les colonnes les moins indispensables
 * peuvent disparaître sans modifier les données ni les actions.
 */
@media(max-width:1100px){
    .tasks-table-v274a th:nth-child(4),
    .tasks-table-v274a td:nth-child(4){
        display:none;
    }
}

@media(max-width:820px){
    .tasks-quick-filters-v274a{
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .tasks-quick-filters-v274a .btn{
        width:100%;
        text-align:center;
    }

    .task-bulk-context-v274a.is-visible{
        position:sticky;
        bottom:76px;
        z-index:20;
        padding:10px;
        border:1px solid var(--border);
        border-radius:12px;
        background:var(--panel);
        box-shadow:0 8px 24px rgba(0,0,0,.16);
    }

    .task-bulk-context-v274a.is-visible .btn{
        flex:1 1 130px;
    }
}

@media(max-width:560px){
    .tasks-quick-filters-v274a{
        grid-template-columns:1fr 1fr;
    }

    /*
     * Matière/type restent disponibles dans le détail de la tâche ;
     * on privilégie ici date, statut et action.
     */
    .tasks-table-v274a th:nth-child(3),
    .tasks-table-v274a td:nth-child(3),
    .tasks-table-v274a th:nth-child(7),
    .tasks-table-v274a td:nth-child(7),
    .tasks-table-v274a th:nth-child(9),
    .tasks-table-v274a td:nth-child(9){
        display:none;
    }
}
/* ================================================================
   V2.7.4b — correctif Tâches
   ================================================================ */

.tasks-quick-filters-v274b{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    align-items:center;
}

.tasks-quick-filter-v274b.active{
    background:var(--accent);
    border-color:var(--accent);
    color:var(--bg);
}

.tasks-advanced-filters-v274b{
    margin-top:12px;
}

.tasks-advanced-filters-v274b>summary{
    cursor:pointer;
    width:max-content;
    font-weight:650;
    color:var(--muted);
    user-select:none;
}

.tasks-advanced-filters-v274b[open]>summary{
    margin-bottom:12px;
}

/*
 * Neutralise le comportement raté de 2.7.4a si ses classes sont encore là.
 */
.tasks-filter-card-v274a > form,
.tasks-filter-card-v274a form.filters{
    display:block;
}

.task-bulk-context-v274a{
    display:none !important;
}

.task-bulk-context-v274b{
    display:none !important;
}

.task-bulk-context-v274b.is-visible{
    display:flex !important;
    align-items:center;
    flex-wrap:wrap;
    gap:8px;
    margin:8px 0 12px;
}

.task-bulk-count-v274b{
    margin-right:auto;
    font-weight:650;
}

.tasks-empty-state-v274b{
    padding:22px 8px 10px;
}

.tasks-empty-state-v274b strong{
    display:block;
    margin-bottom:5px;
}

.tasks-empty-state-v274b p{
    margin:0;
}

@media(max-width:820px){
    .tasks-quick-filters-v274b{
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .tasks-quick-filters-v274b .btn{
        width:100%;
        text-align:center;
    }

    .task-bulk-context-v274b.is-visible{
        position:sticky;
        bottom:76px;
        z-index:25;
        padding:10px;
        border:1px solid var(--border);
        border-radius:12px;
        background:var(--panel);
        box-shadow:0 8px 24px rgba(0,0,0,.16);
    }
}
/* ================================================================
   V2.7.4c — Tâches rendu serveur
   ================================================================ */

.tasks-quick-filters-v274c{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    align-items:center;
}

.tasks-quick-filters-v274c .active{
    background:var(--accent);
    border-color:var(--accent);
    color:var(--bg);
}

.tasks-advanced-filters-v274c{
    margin-top:12px;
}

.tasks-advanced-filters-v274c>summary{
    cursor:pointer;
    width:max-content;
    font-weight:650;
    color:var(--muted);
    user-select:none;
}

.tasks-advanced-filters-v274c[open]>summary{
    margin-bottom:12px;
}

.tasks-advanced-filters-v274c .filters{
    margin:0;
}

.task-bulk-v274c[hidden]{
    display:none !important;
}

.task-bulk-v274c{
    align-items:center;
    flex-wrap:wrap;
    gap:8px;
}

.task-bulk-count-v274c{
    margin-right:auto;
    font-weight:650;
}

.tasks-empty-v274c{
    padding:18px 0 8px;
}

.tasks-empty-v274c strong{
    display:block;
    margin-bottom:5px;
}

.tasks-empty-v274c p{
    margin:0;
}

@media(max-width:820px){
    .tasks-quick-filters-v274c{
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .tasks-quick-filters-v274c .btn{
        width:100%;
        text-align:center;
    }

    .task-bulk-v274c:not([hidden]){
        position:sticky;
        bottom:76px;
        z-index:25;
        padding:10px;
        border:1px solid var(--border);
        border-radius:12px;
        background:var(--panel);
        box-shadow:0 8px 24px rgba(0,0,0,.16);
    }
}
/* ================================================================
   V2.7.4d — rationalisation Contrôles
   ================================================================ */

.exams-primary-actions-v274d{
    display:flex;
    justify-content:flex-end;
    margin:0 0 12px;
}

.exams-list-head-v274d{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    margin-bottom:12px;
}

.exams-list-head-v274d h2,
.exams-list-head-v274d p{
    margin-bottom:0;
}

.exams-list-head-v274d p{
    margin-top:4px;
}

.exams-empty-v274d{
    padding:18px 0 8px;
}

.exams-empty-v274d strong{
    display:block;
    margin-bottom:5px;
}

.exams-empty-v274d p{
    margin:0;
}

.exams-form-card-v274d{
    margin-bottom:16px;
}

@media(max-width:700px){
    .exams-primary-actions-v274d,
    .exams-list-head-v274d{
        align-items:stretch;
    }

    .exams-list-head-v274d{
        flex-direction:column;
    }

    .exams-primary-actions-v274d .btn,
    .exams-list-head-v274d .btn{
        width:100%;
        text-align:center;
    }
}
/* ================================================================
   V2.7.4e — finition Contrôles
   ================================================================ */

.exam-title-link-v274e{
    color:inherit;
    font-weight:700;
    text-decoration:none;
}

.exam-title-link-v274e:hover,
.exam-title-link-v274e:focus-visible{
    text-decoration:underline;
    text-underline-offset:3px;
}
/* ================================================================
   V2.7.4f — actions contextuelles
   ================================================================ */

.topbar{
    min-height:46px;
}

/*
 * Accueil : conserver une hiérarchie simple entre les blocs
 * opérationnels, le calendrier et la progression.
 */
#dashboard-statistics-v273{
    margin-top:16px;
}

#dashboard-statistics-v273 .dashboard-stats-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
}

@media(max-width:560px){
    #dashboard-statistics-v273 .dashboard-stats-grid{
        grid-template-columns:1fr;
    }
}
/* ================================================================
   V2.7.4g — séances planifiées
   ================================================================ */

.planned-sessions-link-v274g{
    display:inline-flex;
    align-items:center;
    min-height:30px;
    padding:4px 9px;
    border:1px solid var(--border);
    border-radius:999px;
    color:var(--muted);
    text-decoration:none;
    font-size:.9em;
}

.planned-sessions-link-v274g:hover,
.planned-sessions-link-v274g:focus-visible{
    color:var(--text);
    border-color:var(--accent);
}

.tasks-exam-context-v274g{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
}

.tasks-exam-context-v274g h2,
.tasks-exam-context-v274g p{
    margin-bottom:4px;
}

@media(max-width:700px){
    .tasks-exam-context-v274g{
        flex-direction:column;
        align-items:stretch;
    }

    .tasks-exam-context-v274g .btn{
        width:100%;
        text-align:center;
    }
}
/* ================================================================
   V2.7.4h — records hebdomadaires
   ================================================================ */

.weekly-records-v274h{
    margin-top:18px;
    padding-top:16px;
    border-top:1px solid var(--border);
}

.weekly-records-v274h h3{
    margin:0 0 12px;
    font-size:1rem;
}

.weekly-records-grid-v274h{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
}

.weekly-record-v274h{
    display:flex;
    flex-direction:column;
    gap:5px;
    padding:14px;
    border:1px solid var(--border);
    border-radius:12px;
    background:color-mix(
        in srgb,
        var(--panel) 94%,
        var(--accent) 6%
    );
}

.weekly-record-label-v274h{
    color:var(--muted);
    font-size:.88rem;
}

.weekly-record-v274h strong{
    font-size:1.28rem;
}

.weekly-challenge-v274h{
    margin-top:5px;
    font-size:.9rem;
    font-weight:650;
}

.weekly-record-empty-v274h{
    grid-column:1/-1;
    margin:0;
}

@media(max-width:700px){
    .weekly-records-grid-v274h{
        grid-template-columns:1fr;
    }
}
/* ================================================================
   V2.7.4i — Aide restructurée
   ================================================================ */

.help-toc{
    position:sticky;
    top:8px;
    z-index:12;
}

.help-section{
    scroll-margin-top:86px;
}

.help-top-button{
    position:fixed;
    right:18px;
    bottom:18px;
    z-index:80;

    display:none;

    min-width:64px;
    min-height:42px;
    padding:8px 12px;

    border:1px solid var(--border);
    border-radius:999px;

    background:var(--panel);
    color:var(--text);

    cursor:pointer;
    box-shadow:0 8px 24px rgba(0,0,0,.18);
}

.help-top-button.is-visible{
    display:block;
}

@media(max-width:820px){
    .help-toc{
        position:static;
    }

    .help-top-button{
        right:12px;
        bottom:82px;
    }
}


/* ================================================================
   V2.7.4l — Paramètres structurés côté serveur + Top propre
   ================================================================ */

.settings-groups-intro-v274l{
    margin-bottom:12px;
}

.settings-category-v274l{
    margin:12px 0;
    border:1px solid var(--border);
    border-radius:14px;
    background:var(--panel);
    overflow:hidden;
}

.settings-category-v274l>summary{
    position:relative;
    display:flex;
    flex-direction:column;
    gap:3px;
    padding:16px 48px 16px 16px;
    cursor:pointer;
    list-style:none;
    user-select:none;
}

.settings-category-v274l>summary::-webkit-details-marker{
    display:none;
}

.settings-category-v274l>summary::after{
    content:'＋';
    position:absolute;
    right:16px;
    top:50%;
    transform:translateY(-50%);
    color:var(--muted);
    font-size:1.25rem;
    line-height:1;
}

.settings-category-v274l[open]>summary::after{
    content:'−';
}

.settings-category-v274l[open]>summary{
    border-bottom:1px solid var(--border);
}

.settings-category-v274l>summary strong{
    font-size:1.08rem;
}

.settings-category-v274l>summary span{
    color:var(--muted);
    font-size:.9rem;
}

.settings-category-body-v274l{
    padding:12px;
}

.settings-category-body-v274l>.card,
.settings-category-body-v274l>section>.card{
    margin-bottom:12px;
}

.settings-category-body-v274l>.card:last-child,
.settings-category-body-v274l>section:last-child>.card{
    margin-bottom:0;
}

.settings-timetable-card-v274l p:last-child{
    margin-bottom:0;
}

/* Le bouton Top est unique et n'apparaît qu'après défilement. */
.help-top-button{
    display:none !important;
}

.help-top-button.is-visible{
    display:flex !important;
    align-items:center;
    justify-content:center;
}

@media(max-width:820px){
    .settings-category-v274l>summary{
        padding:14px 46px 14px 14px;
    }

    .help-top-button{
        right:12px !important;
        bottom:82px !important;
    }
}

/* ================================================================
   V2.7.4n — Aide repliable
   ================================================================ */

.help-category-v274n{
    padding:0;
    overflow:hidden;
    scroll-margin-top:86px;
}

.help-category-v274n>summary{
    position:relative;
    display:flex;
    align-items:center;
    min-height:58px;
    padding:16px 48px 16px 18px;
    cursor:pointer;
    list-style:none;
    user-select:none;
}

.help-category-v274n>summary::-webkit-details-marker{
    display:none;
}

.help-category-v274n>summary::after{
    content:'＋';
    position:absolute;
    right:18px;
    top:50%;
    transform:translateY(-50%);
    color:var(--muted);
    font-size:1.25rem;
    line-height:1;
}

.help-category-v274n[open]>summary::after{
    content:'−';
}

.help-category-v274n[open]>summary{
    border-bottom:1px solid var(--border);
}

.help-category-v274n>summary strong{
    font-size:1.08rem;
}

.help-category-body-v274n{
    padding:16px 18px 18px;
}

.help-category-body-v274n>:first-child{
    margin-top:0;
}

.help-category-body-v274n>:last-child{
    margin-bottom:0;
}

.help-category-v274n[hidden]{
    display:none !important;
}

@media(max-width:700px){
    .help-category-v274n>summary{
        min-height:54px;
        padding:14px 44px 14px 14px;
    }

    .help-category-body-v274n{
        padding:14px;
    }
}
/* V2.7.4p — parcours guidé */
.task-onboarding-v274p{display:flex;align-items:center;justify-content:space-between;gap:18px}
.task-onboarding-v274p h2{margin-bottom:5px}
.task-onboarding-v274p p{margin-bottom:0}
@media(max-width:700px){
  .task-onboarding-v274p{flex-direction:column;align-items:stretch}
  .task-onboarding-v274p .btn{width:100%;text-align:center}
}