/* Ménage — système de design repris de Perso Bank (MonBudget V2, « fintech épurée »), comme Congés.
   Aucun style en ligne : la politique CSP du site n'autorise que cette feuille. */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../fonts/inter-latin-wght.woff2") format("woff2-variations"), url("../fonts/inter-latin-wght.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bg: #F7F8FA;
    --surface: #FFFFFF;
    --surface-2: #F9FAFB;
    --border: #E4E7EC;
    --border-soft: #F2F4F7;
    --border-input: #D0D5DD;
    --text: #101828;
    --text-2: #475467;
    --text-3: #344054;
    --muted: #667085;
    --accent: #4F46E5;
    --accent-strong: #3730A3;
    --accent-soft: #EEF2FF;
    --accent-line: #C7D2FE;
    --row-selected: #F5F7FF;
    --pos: #067647;   --pos-bg: #ECFDF3;  --pos-line: #ABEFC6;  --pos-ink: #054F31;
    --neg: #B42318;   --neg-bg: #FEF3F2;  --neg-line: #FDA29B;
    --warn: #B54708;  --warn-bg: #FFFAEB; --warn-line: #FEDF89; --warn-ink: #7A2E0E;
    --save: #0E7490;  --save-bg: #ECFEFF;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05);
    --sidebar: 264px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-feature-settings: "tnum" 1, "cv11" 1;
    background: var(--bg);
    color: var(--text);
}
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--border-soft); padding: 1px 6px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ── Coque de l'application ─────────────────────────────── */
.app {
    display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh;
    /* colonne blanche de la barre latérale sur toute la hauteur, même quand la page défile */
    background: linear-gradient(to right, var(--surface) calc(var(--sidebar) - 1px), var(--border) calc(var(--sidebar) - 1px), var(--border) var(--sidebar), transparent var(--sidebar));
}
.sidebar {
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: var(--surface); border-right: 1px solid var(--border);
    padding: 20px 16px; display: flex; flex-direction: column; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: var(--text); text-decoration: none; font-size: 16px; font-weight: 700; }
.brand:hover { color: var(--text); }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.brand-tag { font-size: 11px; font-weight: 600; color: var(--accent-strong); background: var(--accent-soft); border-radius: 999px; padding: 1px 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
    display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: var(--radius);
    color: var(--text-3); text-decoration: none; font-size: 14px; font-weight: 500;
}
.nav-item svg { flex: none; }
.nav-item:hover { background: var(--border-soft); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); }
.nav-item.is-soon { color: var(--muted); cursor: default; }
.nav-item.is-soon:hover { background: none; color: var(--muted); }
.nav-label { flex: 1; }
.nav-count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.nav-soon { font-size: 11px; font-weight: 500; color: var(--muted); }
.nav-sep { height: 1px; background: var(--border); margin: 10px 4px; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.sidebar-foot form { margin: 0; }

.main { padding: 32px 40px 48px; display: flex; flex-direction: column; gap: 24px; min-width: 0; max-width: 1360px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.page-sub { margin-top: 4px; font-size: 14px; color: var(--text-2); }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.breadcrumb { font-size: 13px; color: var(--text-2); }
.breadcrumb a { text-decoration: none; }

/* Page sans barre latérale (connexion, erreur hors session) */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 400px; }

/* ── Cartes ─────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.card-flush { padding: 0; gap: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-flush > .card-head { padding: 16px 24px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 16px; font-weight: 600; }
.card-link { font-size: 13px; font-weight: 600; text-decoration: none; }
.card-foot { padding: 12px 24px; font-size: 13px; color: var(--text-2); display: flex; flex-direction: column; gap: 12px; }

.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 24px; }

.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.kpi-label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.kpi-value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.kpi-sub { font-size: 13px; color: var(--text-2); }

/* Étapes du point hebdomadaire */
.step { display: flex; gap: 12px; padding: 14px; border-radius: 10px; border: 1px solid var(--border); align-items: flex-start; }
.step-body { flex: 1; min-width: 0; }
.step-title { font-size: 14px; font-weight: 600; }
.step-text { font-size: 13px; color: var(--text-2); }
.step-mark { width: 24px; height: 24px; flex: none; border-radius: 999px; border: 2px solid #98A2B3; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--text-2); }
.step-link { align-self: center; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.step.is-done { border-color: var(--pos-line); background: var(--pos-bg); }
.step.is-done .step-mark { background: var(--pos); border-color: var(--pos); }
.step.is-done .step-text { color: var(--pos-ink); }
.step.is-todo { border-color: var(--warn-line); background: var(--warn-bg); }
.step.is-todo .step-mark { border-color: var(--warn); color: var(--warn); }
.step.is-todo .step-text { color: var(--warn-ink); }

/* Liste clé / valeur (soldes) */
.kv { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.kv-row dt { color: var(--text); }
.kv-row dd { margin: 0; font-weight: 600; text-align: right; }
.kv-group { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); padding-top: 6px; }
.kv-note { font-size: 12px; color: var(--text-2); font-weight: 400; }

/* ── Boutons ────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px; padding: 0 16px; border-radius: var(--radius); border: 1px solid transparent;
    font: 600 14px/1 "Inter", system-ui, sans-serif; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn-primary:hover { background: var(--accent-strong); color: #FFFFFF; }
.btn-secondary { background: var(--surface); color: var(--text-3); border-color: var(--border-input); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-soft { background: var(--accent-soft); color: var(--accent-strong); }
.btn-danger { background: var(--surface); color: var(--neg); border-color: var(--neg-line); }
.btn-danger:hover { background: var(--neg-bg); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; min-height: 44px; }
.btn-ghost { background: none; border: 0; color: var(--text-2); padding: 0 12px; min-height: 40px; font: 500 14px "Inter", system-ui, sans-serif; cursor: pointer; border-radius: var(--radius); display: flex; align-items: center; gap: 10px; width: 100%; }
.btn-ghost:hover { background: var(--border-soft); color: var(--text); }

/* ── Formulaires ────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-3); }
.input, .select {
    height: 40px; width: 100%; padding: 0 12px; border: 1px solid var(--border-input); border-radius: var(--radius);
    font: 14px "Inter", system-ui, sans-serif; color: var(--text); background: var(--surface);
}
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { font-size: 13px; color: var(--text-2); font-weight: 400; }
.form { display: flex; flex-direction: column; gap: 16px; }
.inline { display: inline; margin: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.dropzone {
    display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
    padding: 28px 20px; border: 1.5px dashed var(--border-input); border-radius: var(--radius-lg); background: var(--surface-2);
}
.dropzone-icon { width: 44px; height: 44px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.dropzone input[type=file] { font: 14px "Inter", system-ui, sans-serif; color: var(--text-2); max-width: 100%; }
.dropzone input[type=file]::file-selector-button {
    margin-right: 12px; min-height: 36px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--border-input);
    background: var(--surface); color: var(--text-3); font: 600 13px "Inter", system-ui, sans-serif; cursor: pointer;
}

/* ── Badges, alertes ────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.badge-accent { background: var(--accent-soft); color: var(--accent-strong); }
.badge-neutral { background: var(--border-soft); color: var(--text-3); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-pos { background: var(--pos-bg); color: var(--pos); }
.badge-neg { background: var(--neg-bg); color: var(--neg); }
.badge-save { background: var(--save-bg); color: var(--save); }
a.tag-note { text-decoration: none; }
a.tag-note:hover { border-color: var(--accent); color: var(--accent-strong); }
.tag-note { white-space: nowrap; display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px; border: 1px dashed #98A2B3; color: var(--text-2); font-size: 12px; font-weight: 500; }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-lg); border: 1px solid; font-size: 14px; }
.alert-icon { width: 22px; height: 22px; flex: none; border-radius: 999px; display: flex; align-items: center; justify-content: center; color: #FFFFFF; }
.alert strong { font-weight: 600; }
.alert-ok { background: var(--pos-bg); border-color: var(--pos-line); color: var(--pos-ink); }
.alert-ok .alert-icon { background: var(--pos); }
.alert-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.alert-warn .alert-icon { background: var(--warn); }
.alert-error { background: var(--neg-bg); border-color: var(--neg-line); color: var(--neg); }
.alert-error .alert-icon { background: var(--neg); }
.alert-info { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-strong); }
.alert-info .alert-icon { background: var(--accent); }

/* ── Tableaux (densité confortable : lignes de 52 px) ───── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    height: 44px; padding: 0 16px; text-align: left; background: var(--surface-2); border-bottom: 1px solid var(--border);
    font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.table td { height: 52px; padding: 6px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table tbody tr:hover { background: var(--row-selected); }
.table .num { text-align: right; white-space: nowrap; }
.table .date { color: var(--text-2); white-space: nowrap; }
.table .strong { font-weight: 500; }
.table .sub { display: block; font-size: 12px; color: var(--text-2); }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .status { flex-wrap: nowrap; justify-content: flex-end; }

.amount { font-weight: 500; white-space: nowrap; color: var(--text-2); }
.amount.neg { color: var(--neg); }
.amount.pos { color: var(--pos); }

.muted { color: var(--text-2); }
.empty { padding: 32px 24px; text-align: center; color: var(--text-2); }
.text-ok { color: var(--pos); font-weight: 600; }
.text-accent { color: var(--accent-strong); font-weight: 600; }
.text-warn { color: var(--warn); font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── À catégoriser ──────────────────────────────────────── */
.work { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.tab { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: var(--radius); color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none; }
.tab:hover { background: var(--border-soft); color: var(--text); }
.tab[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); }
.queue { list-style: none; margin: 0; padding: 0; }
.queue-item { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.queue-item:last-child { border-bottom: 0; }
.queue-item .date { color: var(--text-2); white-space: nowrap; }
.queue-item.is-selected { background: var(--row-selected); box-shadow: inset 3px 0 0 var(--accent); }
.queue-label { min-width: 0; }
.queue-label a { color: var(--text); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.queue-label a:hover { color: var(--accent); }
.queue-label .sub { display: block; font-size: 12px; color: var(--text-2); }
.queue-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.panel { position: sticky; top: 24px; box-shadow: var(--shadow); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.rule { border: 0; border-top: 1px solid var(--border); margin: 0; padding: 16px 0 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rule legend { padding: 0; margin-bottom: 14px; float: left; width: 100%; }
.rule legend .check { font-size: 14px; font-weight: 600; color: var(--text); }
.check-list { display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.grid-2-even { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 1100px) { .work { grid-template-columns: 1fr; } .panel { position: static; } }
@media (max-width: 640px) { .queue-item { grid-template-columns: 1fr auto; } .queue-item .date { grid-column: 1 / -1; } .queue-actions { grid-column: 1 / -1; justify-content: flex-start; } }


/* ── Éléments repris des écrans Opérations, Budget et Analyse ── */
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; padding: 0; border: 1px solid var(--border-input); border-radius: 8px; background: var(--surface); color: var(--muted); cursor: pointer; }
.btn-icon:hover, .btn-icon[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
.btn-icon.is-set { color: var(--accent); }
.btn-icon[hidden] { display: none; }
.select-sm, .input-sm { height: 32px; font-size: 13px; width: auto; min-width: 150px; }
.edit-actions { display: flex; justify-content: flex-end; }
.danger-zone { border-top: 1px solid var(--border); padding-top: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.input-amount { width: 120px; min-width: 0; text-align: right; }
.push-right { margin-left: auto; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-3); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; flex: none; vertical-align: -1px; }
.swatch-line { width: 18px; }

/* ── Volet latéral (modification d'une opération) ───────── */
body:has(.drawer) { overflow: hidden; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(16, 24, 40, .45); cursor: default; animation: fade-in .15s ease-out; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(460px, 100%); overflow-y: auto;
    background: var(--surface); border-left: 1px solid var(--border); box-shadow: -12px 0 32px rgba(16, 24, 40, .18);
    padding: 24px; display: flex; flex-direction: column; gap: 20px; animation: slide-in .2s ease-out; }
.drawer .edit-grid { grid-template-columns: 1fr; }
.drawer .edit-grid > .check { grid-column: auto; }
.drawer .edit-actions { justify-content: stretch; }
.drawer .edit-actions .btn { width: 100%; }
.drawer .card-head { align-items: flex-start; }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-backdrop { animation: none; } }

/* ── Sélecteur de période ───────────────────────────────── */
.period-panel { position: absolute; z-index: 20; top: 44px; left: 0; width: 520px; max-width: calc(100vw - 32px);
    display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: 0 8px 24px rgba(16, 24, 40, .12); overflow: hidden; }
.period-presets { list-style: none; margin: 0; padding: 8px 0; border-right: 1px solid var(--border); }
.period-preset { display: block; width: 100%; text-align: left; padding: 10px 20px; border: 0; background: none; cursor: pointer;
    font: 400 14px "Inter", system-ui, sans-serif; color: var(--text-3); }
.period-preset:hover { background: var(--border-soft); color: var(--text); }
.period-preset[aria-current="true"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.period-custom { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 560px) { .period-panel { grid-template-columns: 1fr; } .period-presets { border-right: 0; border-bottom: 1px solid var(--border); } }

/* ── Écrans étroits ─────────────────────────────────────── */
@media (max-width: 1100px) {
    .grid-2 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; background: none; }
    .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
    .nav { flex-direction: row; flex-wrap: wrap; }
    .nav-item.is-soon, .nav-sep { display: none; }
    .sidebar-foot { margin: 0 0 0 auto; }
    .main { padding: 24px 16px 40px; }
    .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .grid-4 { grid-template-columns: 1fr; }
    .page-title { font-size: 24px; }
}

/* Repris de Congés */
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.form-inline { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 0; }
.field-legend { font-size: 13px; font-weight: 500; color: var(--text-3); padding: 0; margin-bottom: 8px; }
.seg-field { border: 0; margin: 0; padding: 0; display: flex; gap: 8px 20px; flex-wrap: wrap; align-content: flex-start; }
.seg-field > legend { width: 100%; float: left; }
.legend .swatch { width: 14px; height: 14px; border-radius: 4px; }
.tab { border: 0; }

/* ════════════════════════════════════════════════════════════
   Ménage — compléments propres à l'application
   Une couleur par personne (pastilles), une par moment et par fréquence.
   ════════════════════════════════════════════════════════════ */
:root {
    --p-t: #4F46E5;  --p-t-bg: #EEF2FF;
    --p-w: #0E9384;  --p-w-bg: #F0FDF9;
    --mo-matin: #B54708; --mo-soir: #3E4784; --mo-libre: #667085;
    --fq-mensuel: #1570EF;    --fq-mensuel-bg: #EFF8FF;
    --fq-trimestriel: #6938EF; --fq-trimestriel-bg: #F4F3FF;
    --fq-semestriel: #C11574;  --fq-semestriel-bg: #FDF2FA;
    --fq-annuel: #C4320A;      --fq-annuel-bg: #FFF6ED;
}
.js-only { display: none !important; }
.js .js-only { display: inline-flex !important; }
[hidden] { display: none !important; }

/* Pastilles des personnes (initiale) */
.avs { display: inline-flex; gap: 2px; flex: none; vertical-align: middle; }
.av { width: 24px; height: 24px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #FFFFFF; line-height: 1; flex: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.av-sm { width: 18px; height: 18px; font-size: 10px; }
.av-t { background: var(--p-t); }
.av-w { background: var(--p-w); }

/* Moment et fréquence */
.mo { display: inline-flex; align-items: center; flex: none; color: var(--mo-libre); }
.mo-matin { color: var(--mo-matin); }
.mo-soir { color: var(--mo-soir); }
.mo-txt { gap: 6px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.fq { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: none; border-radius: 5px;
    font-size: 11px; font-weight: 700; line-height: 1; border: 1px solid currentColor; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.fq-hebdo { color: var(--muted); background: var(--border-soft); border-color: var(--border); }
.fq-mensuel { color: var(--fq-mensuel); background: var(--fq-mensuel-bg); }
.fq-trimestriel { color: var(--fq-trimestriel); background: var(--fq-trimestriel-bg); }
.fq-semestriel { color: var(--fq-semestriel); background: var(--fq-semestriel-bg); }
.fq-annuel { color: var(--fq-annuel); background: var(--fq-annuel-bg); }
.legend-plan { justify-content: flex-end; font-size: 12px; }
.legend-plan .fq { margin-right: 2px; width: 16px; height: 16px; font-size: 10px; }
.legend-plan li { gap: 6px; }

/* Barre de filtres */
.btn-icon-lg { width: 40px; height: 40px; }
.page-actions .btn[aria-current="true"] { border-color: var(--accent-line); color: var(--accent-strong); background: var(--accent-soft); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.seg-label { font-size: 12px; font-weight: 600; color: var(--text-2); padding: 0 8px 0 6px; }
.tab-av { gap: 6px; }

/* ── Feuille imprimable (semaine et année) : style coloré ──
   Une couleur douce par pièce (pc-0 … pc-9, d'après l'ordre des pièces), bandeau dégradé, pastilles des jours.
   Tout reste lisible en noir et blanc : cases, libellés et initiales ne dépendent pas de la couleur. */
.pc-0 { --pc-bg: #FEF6EE; --pc-bar: #EF6820; --pc-ink: #932F19; }
.pc-1 { --pc-bg: #EFF8FF; --pc-bar: #2E90FA; --pc-ink: #194185; }
.pc-2 { --pc-bg: #ECFDF3; --pc-bar: #17B26A; --pc-ink: #085D3A; }
.pc-3 { --pc-bg: #F4F3FF; --pc-bar: #7A5AF8; --pc-ink: #4A1FB8; }
.pc-4 { --pc-bg: #FDF2FA; --pc-bar: #EE46BC; --pc-ink: #851651; }
.pc-5 { --pc-bg: #FEFBE8; --pc-bar: #EAAA08; --pc-ink: #713B12; }
.pc-6 { --pc-bg: #F0FDF9; --pc-bar: #15B79E; --pc-ink: #134E48; }
.pc-7 { --pc-bg: #FFF1F3; --pc-bar: #F63D68; --pc-ink: #89123E; }
.pc-8 { --pc-bg: #F0F9FF; --pc-bar: #0BA5EC; --pc-ink: #0B4A6F; }
.pc-9 { --pc-bg: #F8F9FC; --pc-bar: #4E5BA6; --pc-ink: #293056; }
.row-matin { --pc-bg: #FFFAEB; --pc-bar: #F79009; --pc-ink: #93370D; }
.row-soir  { --pc-bg: #EEF4FF; --pc-bar: #444CE7; --pc-ink: #2D31A6; }
.row-libre { --pc-bg: #F2F4F7; --pc-bar: #98A2B3; --pc-ink: #344054; }

.sheet { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sheet-band { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 22px; color: #FFFFFF;
    background: radial-gradient(circle at 92% -40%, rgba(238, 70, 188, .55), transparent 55%), linear-gradient(115deg, #4338CA 0%, #4F46E5 45%, #7A5AF8 100%); }
.sheet-brand { display: flex; align-items: center; gap: 14px; }
.sheet-mark { width: 46px; height: 46px; border-radius: 14px; background: #FFFFFF; display: flex; align-items: center; justify-content: center; flex: none;
    box-shadow: 0 4px 12px rgba(16, 24, 40, .18); }
.sheet-kicker { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.sheet-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.sheet-sub { font-size: 13px; opacity: .92; margin-top: 2px; }
.sheet-people { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.sheet-people li { display: flex; align-items: center; gap: 10px; padding: 4px 16px 4px 4px; border-radius: 999px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); }
.sheet-people li > span:last-child { display: flex; flex-direction: column; font-size: 12px; line-height: 1.25; opacity: .95; }
.sheet-people strong { font-size: 14px; font-weight: 700; }
.av-lg { width: 36px; height: 36px; font-size: 16px; box-shadow: 0 0 0 2px #FFFFFF; }
.sheet .empty { padding: 40px 24px; }
.sheet-foot { display: flex; justify-content: space-between; align-items: stretch; gap: 16px; padding: 10px 16px 14px; border-top: 1px dashed var(--border); }
.sheet-foot .legend-plan { justify-content: flex-start; align-content: center; }
.sheet-notes { display: none; }
.box { width: 14px; height: 14px; flex: none; border: 1.6px solid var(--pc-ink, #98A2B3); border-radius: 4px; background: #FFFFFF; margin-top: 1px; }

/* Semaine */
.plan { width: 100%; min-width: 1080px; border-collapse: separate; border-spacing: 4px; table-layout: fixed; font-size: 13px; padding: 4px 8px 2px; }
.plan th, .plan td { vertical-align: top; text-align: left; }
.plan thead th { padding: 4px 0 0; }
.day-pill { display: flex; align-items: baseline; justify-content: center; gap: 6px; height: 34px; align-items: center; border-radius: 10px;
    background: var(--accent-soft); color: var(--accent-strong); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.day-pill .plan-d { font-size: 17px; font-weight: 800; color: var(--accent-strong); }
.is-we .day-pill { background: #FDF2FA; color: #851651; }
.is-we .day-pill .plan-d { color: #851651; }
.day-pill-libre { background: var(--surface-2); color: var(--text-3); border: 1.5px dashed #D0D5DD; }
.plan thead th.is-today .day-pill { background: var(--accent); color: #FFFFFF; }
.plan thead th.is-today .day-pill .plan-d { color: #FFFFFF; }
.plan th.plan-cle { width: 118px; }
.plan tbody th.plan-cle { padding: 10px 10px 10px 14px; border-radius: 12px; background: var(--pc-bg); color: var(--pc-ink); box-shadow: inset 5px 0 0 var(--pc-bar);
    font-size: 13px; font-weight: 700; line-height: 1.25; }
.plan tbody th.plan-cle .mo { margin-right: 6px; vertical-align: -3px; color: var(--pc-bar); }
.plan td { padding: 4px; border-radius: 12px; background: #FCFCFD; border: 1px solid var(--border-soft); }
.plan td.is-we { background: #FFFBFE; }
.plan td.plan-libre { width: 15%; background: var(--surface-2); border: 1.5px dashed var(--border); }
.plan td.is-today { border-color: var(--accent-line); background: #FAFAFF; }
.plan-sans-libre .plan-libre { display: none; }
.its { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.it { display: flex; gap: 7px; align-items: flex-start; padding: 5px 7px; border-radius: 8px; background: var(--pc-bg, var(--surface-2)); box-shadow: inset 3px 0 0 var(--pc-bar, var(--border)); }
.it-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.it-lib { font-size: 12.5px; line-height: 1.3; color: var(--text); font-weight: 500; overflow-wrap: break-word; hyphens: auto; }
.it-meta { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.it-meta .fq { width: 16px; height: 16px; font-size: 10px; border-radius: 5px; }
.it-meta .av-sm { width: 17px; height: 17px; font-size: 9.5px; }
.it-piece { font-size: 11px; color: var(--pc-ink, var(--text-2)); font-weight: 600; }
.it-meta:empty { display: none; }

/* Vue annuelle */
.yr { width: 100%; min-width: 1080px; border-collapse: separate; border-spacing: 3px; table-layout: fixed; font-size: 13px; padding: 4px 8px 2px; }
.yr th, .yr td { text-align: left; }
.yr thead th { padding: 4px 0 2px; }
.yr thead th.yr-tache { font-size: 12px; font-weight: 600; color: var(--text-2); padding-left: 10px; vertical-align: bottom; }
.month-pill { display: flex; align-items: center; justify-content: center; height: 30px; border-radius: 9px; font-size: 12px; font-weight: 700; text-transform: capitalize; }
.ms-hiver { background: #EFF8FF; color: #175CD3; }
.ms-printemps { background: #ECFDF3; color: #067647; }
.ms-ete { background: #FEFBE8; color: #A15C07; }
.ms-automne { background: #FEF6EE; color: #B93815; }
.yr thead th.is-today .month-pill { box-shadow: inset 0 0 0 2px currentColor; }
.yr .yr-tache { width: 290px; }
.yr tbody th.yr-tache { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 34px; padding: 4px 10px 4px 12px;
    border-radius: 8px; background: var(--pc-bg); box-shadow: inset 4px 0 0 var(--pc-bar); font-weight: 500; }
.yr-lib { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.yr td.yr-m { padding: 2px; border-radius: 8px; background: #FCFCFD; border: 1px solid var(--border-soft); text-align: center; vertical-align: middle; }
.yr td.yr-m.is-today { background: #FAFAFF; border-color: var(--accent-line); }
.yr-piece th { padding: 12px 0 2px; }
.piece-chip { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 999px; background: var(--pc-bar); color: #FFFFFF;
    font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.yr-cell { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 6px; border-radius: 999px; background: var(--pc-bg);
    border: 1px solid var(--pc-bar); color: var(--pc-ink); font-size: 12.5px; font-weight: 700; text-decoration: none; }
.yr-cell .box { margin-top: 0; width: 13px; height: 13px; }
a.yr-cell:hover { background: var(--pc-bar); color: #FFFFFF; }

/* Tâches */
.tache-item { grid-template-columns: 18px minmax(0, 1fr) auto auto; }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.day-chk { position: relative; }
.day-chk input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day-chk span { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 34px; padding: 0 6px; border: 1px solid var(--border-input);
    border-radius: var(--radius); font-size: 13px; font-weight: 600; color: var(--text-3); cursor: pointer; background: var(--surface); }
.day-chk input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.day-chk input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check .mo, .check .avs { margin-right: -2px; }
.panel .danger-zone { border-top: 0; padding-top: 12px; }

/* Paramètres */
.piece-item { grid-template-columns: minmax(0, 1fr) 84px auto; }
.piece-item > .badge { justify-self: center; }
.piece-ren { flex-wrap: nowrap; gap: 8px; align-items: center; }
.piece-ren .input-sm { min-width: 0; flex: 1; }
.btn-icon:disabled { opacity: .35; cursor: default; color: var(--muted); border-color: var(--border); }
.piece-del { position: relative; }
.piece-del > summary { list-style: none; }
.piece-del > summary::-webkit-details-marker { display: none; }
.piece-del[open] > summary { color: var(--neg); border-color: var(--neg-line); }
.piece-del-form { position: absolute; right: 0; top: 38px; z-index: 10; width: 240px; display: flex; flex-direction: column; gap: 10px; padding: 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 8px 24px rgba(16, 24, 40, .12); }
.card-foot.form-inline { flex-direction: row; border-top: 1px solid var(--border); padding: 16px 24px; }
.grow { flex: 1; min-width: 180px; }
.field-av > span { display: inline-flex; align-items: center; gap: 8px; }
a.badge { text-decoration: none; }

@media (max-width: 640px) {
    .tache-item { grid-template-columns: 18px minmax(0, 1fr) auto; }
    .tache-item .mo-txt { display: none; }
    .piece-item { grid-template-columns: 1fr auto; }
    .piece-item .piece-ren { grid-column: 1 / -1; }
    .legend-plan { justify-content: flex-start; }
}

.toolbar-group { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Impression : A4 paysage, une feuille (A3 : print-a3.css agrandit le tout) ── */
@page { size: A4 landscape; margin: 7mm; }
@media print {
    html, body { background: #FFFFFF; font-size: 10px; }
    .sidebar, .page-head, .toolbar, .no-print, .alert, .js-only, .panel { display: none !important; }
    .app { display: block; background: none; min-height: 0; }
    .main { padding: 0; gap: 0; max-width: none; }
    .table-wrap { overflow: visible; }
    a { color: inherit; text-decoration: none; }

    /* La feuille occupe toute la hauteur utile (A4 paysage : 210 − 2 × 7 mm) ; le tableau s'étire pour la remplir. */
    .sheet { border: 0; border-radius: 0; overflow: visible; height: 194mm; }
    .sheet > .table-wrap { flex: 1 1 auto; min-height: 0; }
    .plan, .yr { height: 100%; }
    .sheet-band { padding: 3.2mm 5mm; border-radius: 4mm; flex-wrap: nowrap; }
    .sheet-mark { width: 30px; height: 30px; border-radius: 9px; box-shadow: none; }
    .sheet-mark svg { width: 17px; height: 17px; }
    .sheet-kicker { font-size: 8px; }
    .sheet-title { font-size: 19px; }
    .sheet-sub { font-size: 9.5px; }
    .sheet-people li { padding: 2px 10px 2px 2px; gap: 6px; }
    .sheet-people li > span:last-child { font-size: 8.5px; }
    .sheet-people strong { font-size: 10.5px; }
    .av-lg { width: 24px; height: 24px; font-size: 11px; }
    .sheet-foot { padding: 1.5mm 1mm 0; border-top: 0; }
    .sheet-foot .legend-plan { font-size: 8.5px; gap: 2px 10px; flex-direction: column; flex-wrap: nowrap; align-items: flex-start; flex: none; max-width: 42%; }
    .legend-plan .fq { width: 12px; height: 12px; font-size: 7.5px; }
    .legend-plan .mo svg { width: 11px; height: 11px; }
    .sheet-notes { display: block; flex: 1; min-height: 15mm; border: 1.2px dashed #98A2B3; border-radius: 3mm; padding: 1.5mm 3mm;
        background: repeating-linear-gradient(transparent 0 5.2mm, #E4E7EC 5.2mm calc(5.2mm + 1px)); }
    .sheet-notes span { font-size: 8.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #667085; }

    .plan, .yr { min-width: 0; padding: 0; }
    .plan { border-spacing: 2.2px; margin-top: 1.5mm; font-size: 10px; }
    .plan thead th { padding: 0; }
    .day-pill { height: 20px; font-size: 9px; border-radius: 6px; gap: 4px; }
    .day-pill .plan-d { font-size: 12px; }
    .plan thead th.is-today .day-pill { background: var(--accent-soft); color: var(--accent-strong); }
    .plan thead th.is-today .day-pill .plan-d { color: var(--accent-strong); }
    .plan td.is-today { border-color: var(--border-soft); background: #FCFCFD; }
    .plan th.plan-cle { width: 22mm; }
    .plan tbody th.plan-cle { padding: 4px 4px 4px 7px; font-size: 9.5px; border-radius: 6px; box-shadow: inset 3px 0 0 var(--pc-bar); }
    .plan td { padding: 2px; border-radius: 6px; }
    .plan td.plan-libre { width: 13%; }
    .plan tr, .yr tr { break-inside: avoid; }
    .its { gap: 2px; }
    .it { padding: 2px 3px 2px 4px; gap: 4px; border-radius: 4px; box-shadow: inset 2px 0 0 var(--pc-bar, #D0D5DD); }
    .it-lib { font-size: 9.5px; line-height: 1.22; }
    .it-body { gap: 1px; }
    .box { width: 10px; height: 10px; border-width: 1.2px; border-radius: 2.5px; margin-top: 0; }
    .it-meta { gap: 2px; }
    .it-meta .av-sm { width: 12px; height: 12px; font-size: 7px; }
    .it-meta .fq { width: 11px; height: 11px; font-size: 7px; border-radius: 3px; }
    .it-meta .mo svg { width: 10px; height: 10px; }
    .it-piece { font-size: 8px; }

    .yr { border-spacing: 1.6px; margin-top: 1.2mm; font-size: 9.5px; }
    .yr thead th { padding: 0; }
    .month-pill { height: 17px; font-size: 9px; border-radius: 5px; }
    .yr thead th.is-today .month-pill { box-shadow: none; }
    .yr td.yr-m.is-today { background: #FCFCFD; border-color: var(--border-soft); }
    .yr .yr-tache { width: 62mm; }
    .yr thead th.yr-tache { font-size: 8.5px; padding-left: 4px; }
    .yr tbody th.yr-tache { min-height: 0; height: 15px; padding: 0 5px 0 7px; border-radius: 4px; box-shadow: inset 3px 0 0 var(--pc-bar); }
    .yr-lib { gap: 4px; font-size: 9px; }
    .yr .fq { width: 11px; height: 11px; font-size: 7px; border-radius: 3px; }
    .yr .av-sm { width: 12px; height: 12px; font-size: 7px; }
    .yr td.yr-m { padding: 0; border-radius: 4px; height: 15px; }
    .yr-piece th { padding: 2px 0 0; }
    .piece-chip { height: 13px; padding: 0 7px; font-size: 7.5px; }
    .yr-cell { height: 12px; padding: 0 5px 0 3px; gap: 3px; font-size: 8.5px; }
    .yr-cell .box { width: 8px; height: 8px; border-width: 1px; border-radius: 2px; }
    .yr thead { display: table-header-group; }
    .yr thead tr { height: 17px; }
    .sheet-annee .sheet-foot .legend-plan { flex-direction: row; flex-wrap: wrap; max-width: none; gap: 2px 14px; }
}
