/* =========================================================================
   Santé — feuille de style
   ========================================================================= */

:root {
    --bg: #f6f7f5;
    --surface: #ffffff;
    --surface-2: #f0f2ee;
    --border: #e0e3dd;
    --text: #1f2420;
    --muted: #6b716a;
    --accent: #2f9e6e;
    --accent-hover: #268159;
    --accent-soft: #e4f3ec;
    --danger: #c0392b;
    --danger-soft: #fbe9e7;
    --warn: #b8860b;
    --ok: #2f9e6e;
    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .04);
    --sidebar-w: 232px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #16191a;
        --surface: #1e2223;
        --surface-2: #262b2c;
        --border: #333a3b;
        --text: #e6e8e5;
        --muted: #9aa39c;
        --accent: #3fb583;
        --accent-hover: #4cc492;
        --accent-soft: #1e2f28;
        --danger: #e17a6d;
        --danger-soft: #33211f;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 10px rgba(0, 0, 0, .25);
    }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.5rem; margin: 0 0 .2rem; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.push-right { margin-left: auto; }

/* ------------------------------------------------------------------ layout */

.skip {
    position: absolute; left: -999px; top: 0; z-index: 100;
    background: var(--accent); color: #fff; padding: .5rem .8rem;
}
.skip:focus { left: .5rem; top: .5rem; }

.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: .75rem;
    height: 54px; padding: 0 1rem;
    background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; color: var(--text); font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.topbar-logout { margin-left: auto; }

.burger {
    display: none;
    background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 1.1rem; line-height: 1; padding: .35rem .55rem; cursor: pointer; color: var(--text);
}

.shell { display: flex; align-items: flex-start; }

.sidebar {
    width: var(--sidebar-w); flex: none;
    position: sticky; top: 54px; height: calc(100vh - 54px);
    overflow-y: auto; padding: 1rem .75rem;
    background: var(--surface); border-right: 1px solid var(--border);
}
.nav-group {
    margin: 1.1rem .5rem .3rem; font-size: .72rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.nav-list { list-style: none; margin: 0 0 .3rem; padding: 0; }
.nav-list a {
    display: flex; align-items: center; gap: .6rem;
    padding: .5rem .6rem; border-radius: var(--radius-sm);
    color: var(--text); font-size: .93rem;
}
.nav-list a:hover { background: var(--surface-2); text-decoration: none; }
.nav-list a[aria-current] { background: var(--accent-soft); color: var(--accent-hover); font-weight: 600; }
.nav-ico { width: 1.2rem; text-align: center; }

.main {
    flex: 1 1 auto; min-width: 0;
    max-width: 960px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem;
}

.drawer-backdrop { display: none; }

/* -------------------------------------------------------- plain (login) */

.plain-main {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 1.5rem;
}
.card--narrow { max-width: 440px; width: 100%; }

/* --------------------------------------------------------------- cards */

.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 1.15rem 1.2rem; margin-bottom: 1.1rem;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.card-head h2 { margin: 0; }
.card-link { display: inline-block; margin-top: .6rem; font-size: .9rem; }

.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem;
}
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.col-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem 1rem; }

/* ------------------------------------------------------------- buttons */

.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem .9rem; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text); font: inherit; font-size: .9rem; cursor: pointer;
    white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn--primary:hover { background: var(--accent-hover); }

.link-btn {
    background: none; border: none; padding: 0; margin: 0;
    color: var(--accent); font: inherit; cursor: pointer; text-decoration: none;
}
.link-btn:hover { text-decoration: underline; }
.link-btn--danger { color: var(--danger); }

.quick-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

/* ---------------------------------------------------------- stat grid */

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1.25rem; }
.stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: .9rem; text-align: center; color: var(--text); box-shadow: var(--shadow);
}
.stat:hover { text-decoration: none; border-color: var(--accent); }
.stat-n { display: block; font-size: 1.6rem; font-weight: 700; }
.stat-l { display: block; font-size: .8rem; color: var(--muted); }

/* --------------------------------------------------------------- lists */

.tight-list, .day-meals { list-style: none; margin: 0; padding: 0; }
.tight-list li {
    display: flex; justify-content: space-between; gap: 1rem;
    padding: .4rem 0; border-bottom: 1px solid var(--border);
}
.tight-list li:last-child { border-bottom: none; }

.day-meals li {
    display: grid; grid-template-columns: 120px 1fr auto; gap: .5rem 1rem;
    align-items: baseline; padding: .45rem 0; border-bottom: 1px solid var(--border);
}
.day-meals li:last-child { border-bottom: none; }
.meal-type { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-list li { padding: .35rem 0; border-bottom: 1px solid var(--border); }
.ing-list li.opt { color: var(--muted); }
.ing-list li:last-child { border-bottom: none; }
.ing-qty-badge {
    display: inline-block; min-width: 92px; margin-right: .5rem;
    font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem;
}

/* --------------------------------------------------------------- table */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .5rem .6rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
tbody tr:hover { background: var(--surface-2); }
tr.is-inactive td { color: var(--muted); }
.row-actions { display: flex; gap: .7rem; align-items: center; white-space: nowrap; }
.row-actions form { display: inline; }

/* --------------------------------------------------------------- forms */

.form .field { margin-bottom: .9rem; }
.field > label, .field > legend { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
.field .muted { font-weight: 400; }

input[type=text], input[type=number], input[type=url], input[type=date],
input[type=search], input[type=password], select, textarea {
    width: 100%; padding: .5rem .6rem;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent);
}
textarea { resize: vertical; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .8rem; margin: 0; }

.field-err { color: var(--danger); font-size: .85rem; margin: .3rem 0 0; }

.check, .radio { display: flex; align-items: center; gap: .5rem; font-weight: 400; margin: .25rem 0; cursor: pointer; }
.check input, .radio input { width: auto; }
.inline-checks { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: .4rem; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .3rem .55rem; border: 1px solid var(--border); border-radius: 999px;
    font-size: .85rem; font-weight: 400; cursor: pointer; background: var(--surface);
}
.chip input { width: auto; }
.chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hover); }

.form-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }

.filters {
    display: flex; gap: .6rem; flex-wrap: wrap; align-items: center;
    margin-bottom: 1.1rem; padding: .8rem; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
}
.filters input[type=search], .filters select { width: auto; flex: 0 1 220px; }
.filters label { display: inline-flex; align-items: center; gap: .35rem; }

.danger-zone { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px dashed var(--border); }

/* ------------------------------------------------- repeatable row grids */

.ing-head, .ing-row { display: grid; grid-template-columns: 1.6fr 1.2fr .7fr .9fr .9fr auto; gap: .4rem; align-items: center; }
.ex-head, .ex-row { display: grid; grid-template-columns: 1.5fr .7fr .9fr .9fr .7fr .7fr 1.4fr auto; gap: .4rem; align-items: center; }
.set-head, .set-row { display: grid; grid-template-columns: 1.4fr .6fr .7fr .7fr .7fr .9fr 1.3fr auto; gap: .4rem; align-items: center; }
.ing-head, .ex-head, .set-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .35rem; }
.ing-row, .ex-row, .set-row { margin-bottom: .4rem; }
.ing-row input, .ing-row select, .ex-row input, .ex-row select, .set-row input, .set-row select { width: 100%; }
.row-tools { display: flex; gap: .5rem; flex-wrap: wrap; }

.set-field { display: block; min-width: 0; }
.set-field-label { display: none; }

/* ------------------------------------------------------- mode entraînement */

.workout-stage {
    position: fixed; inset: 0; z-index: 60;
    background: var(--bg); display: flex; flex-direction: column;
    padding: 1rem; padding-bottom: max(1rem, env(safe-area-inset-bottom));
    overflow-y: auto;
}
.workout-stage[hidden] { display: none; }

.workout-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.workout-progress { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.workout-close {
    font-size: 1.4rem; line-height: 1; background: none; border: none; color: var(--muted);
    cursor: pointer; padding: .3rem .5rem;
}
.workout-close:hover { color: var(--text); }

.workout-exo-name { font-size: 1.4rem; font-weight: 700; margin: .1rem 0 .5rem; }
.workout-cible {
    background: var(--accent-soft); color: var(--accent-hover); border-radius: var(--radius);
    padding: .7rem .9rem; font-size: 1.1rem; margin: 0 0 .7rem;
}
.workout-cible small { font-weight: 500; font-size: .8rem; }
.workout-rappel {
    background: var(--surface-2); border-radius: var(--radius-sm); padding: .5rem .8rem;
    font-size: .85rem; color: var(--text); margin-bottom: 1rem;
}
.workout-rappel summary { cursor: pointer; font-weight: 600; color: var(--muted); font-size: .78rem; }
.workout-rappel p { margin: .5rem 0 0; }

.workout-stage .set-row {
    display: flex; flex-wrap: wrap; gap: .8rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.1rem; box-shadow: var(--shadow);
}
.workout-stage .set-field { flex: 1 1 130px; }
.workout-stage .set-field--wide { flex-basis: 100%; }
.workout-stage .set-field-label { display: block; font-size: .75rem; color: var(--muted); margin-bottom: .2rem; }
.workout-stage .set-row input, .workout-stage .set-row select {
    font-size: 1.15rem; padding: .6rem .65rem; width: 100%; max-width: none;
}
.workout-stage .set-row button[data-row-remove] { display: none; }

.workout-actions { display: flex; gap: .6rem; margin-top: 1.2rem; }
.workout-actions[hidden] { display: none; }
.workout-actions button[disabled] { opacity: .4; }
.workout-actions .btn { flex: 1; text-align: center; }

.workout-timer { text-align: center; padding: 2.5rem 1rem; margin: auto 0; }
.workout-timer[hidden] { display: none; }
.workout-timer-count { font-size: 3.4rem; font-weight: 800; font-variant-numeric: tabular-nums; margin-bottom: .3rem; }
.workout-timer-label { color: var(--muted); margin-bottom: 1.4rem; }
.workout-timer-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

/* --------------------------------------------------------------- misc */

.badge {
    display: inline-block; padding: .2rem .55rem; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent-hover);
    font-size: .8rem; font-weight: 600; white-space: nowrap;
}
.pill {
    display: inline-block; padding: .1rem .45rem; border-radius: 999px;
    background: var(--surface-2); color: var(--muted); font-size: .74rem; font-weight: 600;
    vertical-align: middle;
}
.pill--ok { background: var(--accent-soft); color: var(--accent-hover); }
.pill--warn { background: var(--danger-soft); color: var(--danger); }

.flash-stack { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.flash { padding: .65rem .85rem; border-radius: var(--radius-sm); font-size: .9rem; border: 1px solid transparent; }
.flash--ok { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hover); }
.flash--err { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.flash--info { background: var(--surface-2); border-color: var(--border); }

.empty {
    padding: 2rem 1rem; text-align: center; color: var(--muted);
    background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
}

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .9rem; }
.recipe-card {
    display: block; padding: 1rem; color: var(--text);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.recipe-card:hover { text-decoration: none; border-color: var(--accent); }
.recipe-card-top { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.recipe-card-top h2 { font-size: 1.02rem; margin: 0; }
.recipe-macros { display: flex; flex-wrap: wrap; gap: .3rem .7rem; margin: .5rem 0 0; font-size: .85rem; color: var(--muted); }

.macro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin: .5rem 0; }
.macro-grid > div { text-align: center; padding: .5rem; background: var(--surface-2); border-radius: var(--radius-sm); }
.macro-n { display: block; font-size: 1.1rem; font-weight: 700; }
.macro-l { display: block; font-size: .75rem; color: var(--muted); }

.prose { white-space: normal; }

.glossaire { margin: 0; }
.glossaire dt { font-weight: 600; margin-top: .7rem; }
.glossaire dt:first-child { margin-top: 0; }
.glossaire dd { margin: .1rem 0 0; color: var(--muted); }
.glossaire dd em { font-style: italic; }
.error-code { font-size: 3rem; font-weight: 800; color: var(--muted); margin: 0; }

.ex-block { border-top: 1px solid var(--border); padding-top: .5rem; margin-top: .8rem; }
.ex-block:first-of-type { border-top: none; margin-top: 0; }

.w-xs { max-width: 90px; }
.w-sm { max-width: 130px; }

/* --------------------------------------------------------- responsive */

@media (max-width: 860px) {
    .col-2, .grid-3 { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
    .burger { display: inline-flex; }
    .sidebar {
        position: fixed; top: 0; left: 0; height: 100vh; z-index: 40;
        transform: translateX(-100%); transition: transform .2s ease;
        box-shadow: var(--shadow);
    }
    body.drawer-open .sidebar { transform: translateX(0); }
    body.drawer-open .drawer-backdrop {
        display: block; position: fixed; inset: 0; z-index: 30;
        background: rgba(0, 0, 0, .4);
    }
    .main { padding: 1rem .9rem 4rem; }
    .grid-2 { grid-template-columns: 1fr; }
    .day-meals li { grid-template-columns: 1fr; gap: .1rem; }
    .ing-head, .ex-head, .set-head { display: none; }
    .ing-row, .ex-row, .set-row {
        grid-template-columns: 1fr 1fr; gap: .4rem;
        padding: .6rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
        background: var(--surface-2);
    }
    .ing-row select:first-child, .ex-row select:first-child, .set-row select:first-child { grid-column: 1 / -1; }
    .ing-row button[data-row-remove], .ex-row button[data-row-remove], .set-row button[data-row-remove] {
        grid-column: 1 / -1; justify-self: end;
    }
    .w-xs, .w-sm { max-width: none; }
}

@media (min-width: 761px) {
    .drawer-backdrop { display: none !important; }
}

/* ------------------------------------------------------ planificateur */

.menu-toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.menu-toolbar form { display: inline; }

.menu-tool { position: relative; }
.menu-tool > summary { list-style: none; cursor: pointer; }
.menu-tool > summary::-webkit-details-marker { display: none; }
.menu-tool-pop {
    position: absolute; z-index: 15; right: 0; margin-top: .4rem; width: min(320px, 88vw);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: .9rem; display: flex; flex-direction: column; gap: .7rem;
}
.menu-tool-pop .field { margin: 0; font-size: .85rem; }

.menu-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
.menu-day {
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: .45rem;
}
.menu-day[data-today] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.menu-day-head {
    font-weight: 700; font-size: .8rem; text-align: center;
    padding-bottom: .35rem; margin-bottom: .35rem; border-bottom: 1px solid var(--border);
}
.menu-slot { margin-bottom: .45rem; }
.menu-slot-label {
    font-size: .66rem; text-transform: uppercase; letter-spacing: .03em;
    color: var(--muted); margin-bottom: .2rem;
}
.menu-entry {
    background: var(--surface-2); border-radius: var(--radius-sm);
    padding: .35rem .45rem; margin-bottom: .3rem; font-size: .82rem;
}
.menu-entry.is-eaten { opacity: .6; }
.menu-entry-name { display: block; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.menu-entry-meta { display: block; color: var(--muted); font-size: .72rem; }
.menu-entry-eat, .menu-entry-flag { font-size: .72rem; }
.menu-entry-flag { color: var(--accent-hover); }
.menu-entry-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .15rem; }
.menu-entry-actions form { display: inline; }
.menu-entry-actions .link-btn { font-size: .72rem; }

.gen-resume {
    background: var(--accent-soft); border: 1px solid var(--accent);
    border-radius: var(--radius); padding: .7rem .9rem; margin-bottom: 1rem;
    font-size: .88rem; color: var(--text);
}
.gen-resume-manques { margin-top: .3rem; font-size: .82rem; color: var(--danger); }
.menu-add {
    display: block; text-align: center; padding: .2rem;
    border: 1px dashed var(--border); border-radius: var(--radius-sm);
    color: var(--muted); font-weight: 700; line-height: 1.2;
}
.menu-add:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.menu-day-total {
    margin-top: auto; padding-top: .4rem; border-top: 1px solid var(--border);
    font-size: .74rem; text-align: center; color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.menu-day-total .over { color: var(--danger); font-weight: 600; }

@media (max-width: 900px) {
    .menu-week { grid-template-columns: 1fr; }
    .menu-day { padding: .8rem; }
    .menu-day-head { text-align: left; font-size: .9rem; }
    .menu-add { max-width: 3rem; }
}

/* ------------------------------------------------------- batchcooking */

.section-title { margin: 1.6rem 0 .8rem; }
.card--alert { border-color: var(--warn); }

.exp-soon { color: var(--warn); font-weight: 600; }
.exp-over { color: var(--danger); font-weight: 600; }

.stock-list { list-style: none; margin: 0; padding: 0; }
.stock-list li {
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
    padding: .6rem 0; border-bottom: 1px solid var(--border);
}
.stock-list li:last-child { border-bottom: none; }
.stock-main { flex: 1 1 200px; display: flex; flex-direction: column; }
.stock-qty { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.stock-take { display: flex; gap: .4rem; align-items: center; }
.stock-take input { max-width: 70px; }

.batch-head, .batch-row { display: grid; gap: .4rem; align-items: center; }
.batch-head { grid-template-columns: 1.4fr 1fr .7fr .8fr 1.1fr auto; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .35rem; }
.batch-row  { grid-template-columns: 1.4fr 1fr .7fr .8fr 1.1fr auto; margin-bottom: .4rem; }
.batch-head.editing, .batch-row.editing { grid-template-columns: 1.3fr .9fr .6fr .6fr .8fr 1fr .8fr auto; }
.batch-row input, .batch-row select { width: 100%; }

@media (max-width: 780px) {
    .batch-head { display: none; }
    .batch-row {
        grid-template-columns: 1fr 1fr; gap: .4rem;
        padding: .6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
    }
    .batch-row select[name="item_recette_id[]"] { grid-column: 1 / -1; }
    .batch-row button[data-row-remove] { grid-column: 1 / -1; justify-self: end; }
}

/* --------------------------------------------------- liste de courses */

.course-rayon h2 { font-size: 1rem; padding-bottom: .35rem; border-bottom: 2px solid var(--border); }
.course-list { list-style: none; margin: 0; padding: 0; }
.course-item { display: flex; align-items: flex-start; gap: .3rem; border-bottom: 1px solid var(--border); }
.course-item:last-child { border-bottom: none; }
.course-item form[data-toggle] { flex: 1 1 auto; min-width: 0; }

.course-tick {
    display: flex; align-items: flex-start; gap: .6rem;
    background: none; border: none; text-align: left; font: inherit; color: var(--text);
    padding: .55rem .2rem; cursor: pointer; width: 100%;
}
.course-box {
    flex: none; width: 1.15rem; height: 1.15rem; margin-top: .1rem;
    border: 1.5px solid var(--muted); border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem; color: var(--accent-hover); line-height: 1;
}
.course-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .5rem; }
.course-qty { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 3.5rem; }
.course-name { font-weight: 500; }
.course-src { font-size: .76rem; color: var(--muted); }
.course-del { padding: .55rem .3rem 0 0; }

.course-item.is-checked .course-tick { opacity: .5; }
.course-item.is-checked .course-name { text-decoration: line-through; }
.course-item.is-checked .course-box { border-color: var(--accent); background: var(--accent-soft); }

/* ------------------------------------------------------ séance du jour */

.prop-table td { vertical-align: top; }
.prop-table td:nth-child(4) { white-space: nowrap; }
.prop-note { font-size: .78rem; color: var(--accent-hover); }

.adapt-pop { width: min(420px, 90vw); }
.adapt-pop .chips { max-height: 8.5rem; overflow-y: auto; }
.adapt-modifs { margin: .4rem 0 0; padding-left: 1.1rem; font-size: .85rem; }
.adapt-modifs li { margin: .15rem 0; }

/* --------------------------------------------------------- graphiques */

.chart-wrap { max-width: 660px; margin: .3rem 0 .2rem; overflow-x: auto; }
.chart { width: 100%; height: auto; display: block; font-family: var(--font); }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-label { fill: var(--muted); font-size: 10px; }
.chart-line { stroke: var(--accent); stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.chart-line--faint { stroke: var(--muted); stroke-width: 1.5; opacity: .55; stroke-dasharray: 3 3; }
.chart-area { fill: var(--accent); opacity: .12; }
.chart-dot { fill: var(--accent); }
.chart-bar { fill: var(--accent); opacity: .85; }
.chart-target { stroke: var(--danger); stroke-width: 1.5; stroke-dasharray: 5 3; }

.chart-legend { font-size: .78rem; color: var(--muted); display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.chart-legend .lg { display: inline-block; width: 14px; height: 0; border-top-width: 2px; border-top-style: solid; margin: 0 .1rem 0 .5rem; }
.lg-line { border-top-color: var(--accent); }
.lg-faint { border-top-color: var(--muted); border-top-style: dashed; }
.lg-target { border-top-color: var(--danger); border-top-style: dashed; }

/* ---------------------------------------------------------- impression */

@media print {
    .topbar, .sidebar, .drawer-backdrop, .skip, .no-print, .flash-stack { display: none !important; }
    body { background: #fff; color: #000; font-size: 12pt; }
    .shell { display: block; }
    .main { max-width: none; margin: 0; padding: 0; }
    .card {
        box-shadow: none; border: none; border-radius: 0;
        padding: 0; margin: 0 0 1rem; page-break-inside: avoid;
    }
    .page-head { margin-bottom: .5rem; }
    .course-rayon h2 { border-color: #000; }
    .course-item { border-color: #ccc; }
    .course-box { border-color: #000; }
    .course-item.is-checked .course-tick { opacity: 1; }
    a[href]::after { content: ""; }
}
