/* SALTI Planner — charte : jaune #FFDD00 / noir / blanc, typo Lato */

:root {
    --yellow: #FFDD00;
    --yellow-dark: #F0CF00;
    --black: #000000;
    --white: #FFFFFF;
    --surface: #F5F5F5;
    --border: #E5E5E5;
    --muted: #6B6B6B;
    --danger: #D92D20;
    --ok: #039855;
    --info: #0B5CAD;
    --warn: #DC6803;
    --font: 'Lato', system-ui, sans-serif;
    --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 14px rgba(0,0,0,0.06);
    --radius: 6px;
}

[data-theme="dark"] {
    --black: #F5F5F5;
    --white: #111214;
    --surface: #1A1C20;
    --border: #2A2D33;
    --muted: #9AA0A6;
}

/* En dark mode, tout ce qui a un fond jaune doit garder du texte NOIR réel (pas inversé) */
[data-theme="dark"] .btn,
[data-theme="dark"] .user-chip,
[data-theme="dark"] .brand-mark,
[data-theme="dark"] .main-nav a.active,
[data-theme="dark"] .main-nav a.nav-help.active,
[data-theme="dark"] .main-nav a.nav-help:hover,
[data-theme="dark"] .year-switcher a.active,
[data-theme="dark"] .week-header .wh-week,
[data-theme="dark"] .month-title,
[data-theme="dark"] .guide-hero,
[data-theme="dark"] .guide-hero h1,
[data-theme="dark"] .guide-hero .subtitle,
[data-theme="dark"] .guide-step-num,
[data-theme="dark"] .guide-mock-week,
[data-theme="dark"] h1 .accent,
[data-theme="dark"] .badge-ferie,
[data-theme="dark"] .icon-btn:hover {
    color: #000000 !important;
    -webkit-text-stroke: 0.3px #000000;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: var(--font);
    font-weight: 400;
    background: var(--white);
    color: var(--black);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--black); }

button { font-family: inherit; cursor: pointer; }

/* ============================================
   APP SHELL : Sidebar + zone principale
   ============================================ */
.app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}
.app-main {
    display: flex; flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--surface);
}

/* ===== SIDEBAR ===== */
.sidebar {
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: sticky; top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar-head {
    padding: 18px 16px 14px;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: var(--black);
}
.sidebar-brand .brand-mark {
    width: 34px; height: 34px;
    background: var(--yellow);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 18px;
    border-radius: 6px;
    color: #000;
    flex-shrink: 0;
}
.sidebar-brand-text { line-height: 1.1; }
.sidebar-brand-name { font-weight: 900; font-size: 15px; letter-spacing: 0.3px; }
.sidebar-brand-sub { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar-nav {
    flex: 1;
    padding: 14px 10px;
    display: flex; flex-direction: column;
    gap: 1px;
}
.sidebar-group-label {
    font-size: 10px; font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    padding: 14px 8px 6px;
}
.sidebar-group-label:first-child { padding-top: 0; }
.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px; font-weight: 700;
    color: var(--black);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    line-height: 1.3;
    white-space: nowrap;
}
.sidebar-link:hover { background: var(--surface); }
.sidebar-link.is-active {
    background: var(--yellow);
    color: var(--black);
    box-shadow: 0 2px 0 rgba(0,0,0,0.05);
}

.sidebar-foot {
    border-top: 1px solid var(--border);
    padding: 12px;
    background: var(--white);
}
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    background: var(--surface);
    border-radius: 6px;
    text-decoration: none;
    color: var(--black);
    margin-bottom: 8px;
}
.sidebar-user:hover { background: #FFF6B8; }
.sidebar-user-avatar {
    width: 32px; height: 32px;
    background: var(--yellow);
    color: #000;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 15px;
    flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; flex: 1; }
.sidebar-user-name { font-weight: 900; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }

.sidebar-actions {
    display: flex; gap: 4px;
}
.sidebar-actions .icon-btn {
    flex: 1; justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    padding: 6px 8px;
    color: var(--black);
}
.sidebar-actions .icon-btn:hover { background: var(--yellow); border-color: var(--yellow); }

/* ===== MOBILE TOPBAR ===== */
.topbar-mobile {
    display: none;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
    justify-content: space-between; align-items: center;
    position: sticky; top: 0; z-index: 40;
}
.topbar-mobile .brand-mark {
    width: 34px; height: 34px; font-size: 18px;
    background: var(--yellow); color: #000;
    border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 900;
}

/* ===== FLOATING ACTION BUTTON (FAB) ===== */
.fab-wrap {
    position: fixed;
    right: 24px; bottom: 24px;
    z-index: 60;
}
.fab {
    width: 56px; height: 56px;
    background: var(--yellow);
    color: #000;
    border: 2px solid #000;
    border-radius: 50%;
    font-size: 28px; font-weight: 900;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}
.fab:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 28px rgba(255,221,0,0.5);
}
.fab.is-open { transform: rotate(45deg); }
.fab-menu {
    position: absolute;
    bottom: 72px; right: 0;
    display: flex; flex-direction: column-reverse; gap: 8px;
    opacity: 0; pointer-events: none;
    transition: opacity 0.18s;
}
.fab-menu.is-open { opacity: 1; pointer-events: auto; }
.fab-item {
    display: flex; align-items: center; gap: 10px;
    background: var(--white);
    color: var(--black);
    padding: 10px 16px 10px 12px;
    border-radius: 28px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    font-weight: 700; font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    transform: translateY(10px);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s, background 0.12s;
}
.fab-menu.is-open .fab-item {
    transform: translateY(0);
    opacity: 1;
}
.fab-menu.is-open .fab-item:nth-child(1) { transition-delay: 0.0s; }
.fab-menu.is-open .fab-item:nth-child(2) { transition-delay: 0.04s; }
.fab-menu.is-open .fab-item:nth-child(3) { transition-delay: 0.08s; }
.fab-menu.is-open .fab-item:nth-child(4) { transition-delay: 0.12s; }
.fab-item:hover { background: var(--yellow); }
.fab-item-icon {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--yellow); color: #000;
    border-radius: 50%;
    font-size: 16px;
}

/* ===== TOAST SYSTEM ===== */
.toast-stack {
    position: fixed;
    bottom: 24px; left: 50%;
    transform: translateX(-50%);
    z-index: 120;
    display: flex; flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
}
.toast {
    background: var(--white);
    color: var(--black);
    padding: 12px 18px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border-left: 4px solid var(--yellow);
    font-weight: 700; font-size: 14px;
    min-width: 300px; max-width: 500px;
    pointer-events: auto;
    display: flex; align-items: center; gap: 10px;
    animation: toast-in 0.25s;
}
.toast.is-leaving { animation: toast-out 0.2s forwards; }
.toast.toast-success { border-left-color: var(--ok); }
.toast.toast-error   { border-left-color: var(--danger); }
.toast.toast-info    { border-left-color: var(--info); }
.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}
.toast-msg { flex: 1; line-height: 1.4; }
.toast-close {
    background: transparent; border: 0;
    cursor: pointer;
    color: var(--muted);
    font-size: 18px; line-height: 1;
    padding: 0 4px;
}
.toast-action {
    background: var(--black); color: var(--yellow);
    border: 0; padding: 6px 10px;
    border-radius: 4px;
    font-weight: 900; font-size: 12px;
    cursor: pointer;
}
@keyframes toast-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}

/* Old flash fallback */
.flash { display: none; }

/* ===== RESPONSIVE : Sidebar en drawer sur mobile ===== */
@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }
    .topbar-mobile {
        display: flex;
    }
    .sidebar {
        position: fixed;
        top: 0; left: 0;
        width: 260px;
        transform: translateX(-105%);
        transition: transform 0.22s ease-out;
        z-index: 70;
        box-shadow: 8px 0 24px rgba(0,0,0,0.15);
    }
    .sidebar.is-open { transform: translateX(0); }
    .nav-overlay {
        display: none;
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 60;
    }
    .nav-overlay.is-open { display: block; }
}

/* ============================================
   (ancienne) Topbar — gardée pour compat
   ============================================ */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: var(--white);
    color: var(--black);
    border-bottom: 4px solid var(--yellow);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
[data-theme="dark"] .topbar { background: var(--white); }

.topbar-inner {
    max-width: 1600px; margin: 0 auto;
    display: flex; align-items: center; gap: 16px;
    padding: 12px 20px;
    position: relative;
}

/* Burger — visible sur mobile uniquement */
.nav-burger {
    display: none;
    width: 36px; height: 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    padding: 8px 9px;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
}
.nav-burger span {
    display: block;
    height: 2px; background: var(--black);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}
.nav-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 45;
}
.nav-overlay.is-open { display: block; }

.nav-mobile-user { display: none; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--black) !important; }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    background: var(--yellow); color: var(--black);
    font-weight: 900; font-size: 20px;
    border-radius: 4px;
}
.brand-name { font-weight: 900; letter-spacing: 0.5px; color: var(--black); }
.brand-name em { font-weight: 400; font-style: normal; color: var(--black); opacity: 0.5; }

.main-nav { display: flex; gap: 2px; flex: 1; flex-wrap: nowrap; overflow: visible; }
.main-nav a {
    color: var(--black); padding: 7px 12px;
    border-radius: 4px; font-weight: 700; font-size: 13px;
    transition: background 0.15s, color 0.15s;
    position: relative;
    white-space: nowrap;
}
.main-nav a:hover { background: #FFF6B8; color: var(--black); }
.main-nav a.active {
    background: var(--yellow);
    color: var(--black);
}

.topbar-right { display: flex; gap: 8px; align-items: center; }
.icon-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--surface); color: var(--black);
    border: 1px solid var(--border);
    padding: 7px 10px; border-radius: 4px;
    font-size: 13px; font-weight: 700;
}
.icon-btn:hover { background: var(--yellow); border-color: var(--yellow); }
.kbd {
    font-size: 11px; padding: 1px 6px;
    background: var(--black); color: var(--white);
    border-radius: 3px; font-weight: 700;
}

.user-chip {
    padding: 6px 12px; background: var(--yellow); color: var(--black);
    border-radius: 4px; font-weight: 700; font-size: 13px;
}
.link-btn {
    background: transparent; border: 0; color: var(--black);
    font-size: 13px; text-decoration: underline; padding: 6px 4px;
    font-family: inherit;
}

/* Footer — seul endroit où le noir est dominant */
.site-footer {
    margin-top: 60px;
    background: var(--black);
    color: var(--white);
    padding: 28px 20px;
    border-top: 6px solid var(--yellow);
}
.site-footer-inner {
    max-width: 1600px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; flex-wrap: wrap;
}
.site-footer .brand-mark { width: 30px; height: 30px; font-size: 16px; }
.site-footer .footer-brand { display: flex; align-items: center; gap: 10px; color: var(--white); font-weight: 900; font-size: 15px; }
.site-footer .footer-brand em { font-weight: 300; color: var(--yellow); font-style: normal; }
.site-footer .footer-meta { font-size: 12px; color: rgba(255,255,255,0.6); }
.site-footer a { color: var(--yellow); }

/* Page container (à l'intérieur de .app-main) */
.page {
    flex: 1;
    padding: 32px 40px 100px;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    background: var(--white);
    min-height: calc(100vh - 0px);
}
@media (max-width: 900px) {
    .page { padding: 20px 16px 80px; }
}

/* Flash */
.flash {
    max-width: 1600px; margin: 12px auto -8px;
    padding: 10px 16px; border-radius: var(--radius);
    font-weight: 700; font-size: 14px;
}
.flash-success { background: #e8f7ee; color: var(--ok); border-left: 4px solid var(--ok); }
.flash-error   { background: #fdecec; color: var(--danger); border-left: 4px solid var(--danger); }
.flash-info    { background: #eaf3fd; color: var(--info); border-left: 4px solid var(--info); }

/* Titres */
h1 {
    font-size: 36px; font-weight: 900; letter-spacing: -1px;
    margin-bottom: 4px;
    line-height: 1.1;
}
h1 .accent {
    display: inline-block;
    background: var(--yellow);
    color: var(--black);
    padding: 0 8px; border-radius: 4px;
    margin-left: 2px;
}
h2 { font-size: 22px; font-weight: 700; margin: 28px 0 12px; }
h3 { font-size: 16px; font-weight: 700; margin: 16px 0 8px; }
.subtitle { color: var(--muted); margin-bottom: 24px; font-size: 14px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--yellow); color: var(--black);
    border: 0; padding: 10px 18px; border-radius: 4px;
    font-weight: 700; font-size: 14px;
    transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: var(--yellow-dark); }
.btn:active { transform: translateY(1px); }
.btn-secondary {
    background: transparent; border: 2px solid var(--black);
    color: var(--black);
}
.btn-secondary:hover { background: var(--black); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #b51f14; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* Cards */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.card-accent { border-left: 4px solid var(--yellow); }

/* Grid utilities */
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.col { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; } }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="date"], .field input[type="number"], .field select, .field textarea, textarea, input[type=text], input[type=email], input[type=password], select {
    width: 100%; padding: 10px 12px;
    background: var(--surface); color: var(--black);
    border: 1px solid var(--border); border-radius: 4px;
    font-family: var(--font); font-size: 14px;
}
.field textarea, textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--yellow);
    border-color: var(--yellow);
}

.inline-form { display: flex; gap: 8px; align-items: flex-end; }

/* Stats tiles — jaune dominant, texte noir forcé (lisible en dark mode aussi) */
.stat {
    padding: 20px 22px; border-radius: var(--radius);
    background: var(--yellow); border: 0;
    color: #000000;
    transition: transform 0.15s;
    border: 2px solid #000000;
}
.stat:hover { transform: translateY(-2px); }
.stat-value {
    font-size: 40px; font-weight: 900; line-height: 1;
    color: #000000;
    -webkit-text-stroke: 1px #000000;
    text-shadow: 0 1px 0 rgba(0,0,0,0.15);
}
.stat-label {
    color: #000000; font-size: 13px; margin-top: 6px; font-weight: 900;
    text-transform: uppercase; letter-spacing: 0.5px;
    -webkit-text-stroke: 0.4px #000000;
}

/* Badges */
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-idee     { background: #EEE; color: #555; }
.badge-a_faire  { background: #FEF4E6; color: var(--warn); }
.badge-planifie { background: #E6F1FC; color: var(--info); }
.badge-publie   { background: #E6F6EE; color: var(--ok); }

.badge-ferie            { background: var(--yellow); color: var(--black); }
.badge-journee_mondiale { background: #EEE; color: #333; }
.badge-salti            { background: var(--black); color: var(--yellow); }
.badge-salon            { background: #E6F1FC; color: var(--info); }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: top; }
th { background: var(--surface); font-weight: 700; }
tbody tr:hover { background: var(--surface); }

/* Calendrier — nouvelle grille : canaux × semaines avec bulles */
.cal-grid {
    display: grid;
    grid-template-columns: 140px repeat(var(--n-weeks, 5), 1fr);
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
    background: var(--white);
}

/* Entête colonnes */
.cal-head-canal,
.cal-head-week {
    background: var(--black);
    color: var(--yellow);
    padding: 10px 12px;
    font-weight: 900;
    font-size: 13px;
    text-align: center;
    border-right: 1px solid #333;
}
.cal-head-canal { text-align: left; }
.cal-head-week.is-current-week { background: var(--yellow); color: var(--black); }
.cal-head-week-num { font-size: 14px; }
.cal-head-week-dates {
    font-size: 11px; font-weight: 400; opacity: 0.8; margin-top: 2px;
}
.cal-dup-btn {
    background: transparent; border: 1px solid rgba(255,221,0,0.3);
    color: var(--yellow);
    width: 20px; height: 20px; padding: 0;
    border-radius: 3px; font-size: 11px;
    cursor: pointer; margin-left: 4px;
    line-height: 1;
}
.cal-dup-btn:hover { background: var(--yellow); color: #000; border-color: var(--yellow); }

/* Bandeau événements */
.cal-events-label {
    background: #FFF9D9;
    color: var(--black);
    border-top: 1px solid var(--border);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cal-week-events {
    background: #FFF9D9;
    padding: 6px 8px;
    border-right: 1px solid var(--border);
    border-top: 1px solid var(--border);
    border-bottom: 1px dashed var(--yellow);
    display: flex; flex-wrap: wrap; gap: 3px;
    font-size: 10px;
    min-height: 28px;
    max-height: 54px;
    overflow-y: auto;
    align-content: flex-start;
}
.cal-week-events::-webkit-scrollbar { width: 4px; }
.cal-week-events::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 2px; }
.cal-event-badge {
    padding: 1px 6px;
    background: var(--white);
    border: 1px solid #E9D674;
    border-radius: 10px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-size: 9.5px;
    line-height: 1.4;
    cursor: default;
}
.cal-event-badge:hover { background: var(--yellow); }

/* Canal label */
.cal-canal-label {
    background: var(--surface);
    padding: 14px 12px;
    font-weight: 900;
    font-size: 13px;
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    display: flex; align-items: center;
}

/* Slot : une case (semaine × canal) qui peut contenir plusieurs bulles */
.cal-slot {
    position: relative;
    padding: 6px;
    min-height: 70px;
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 4px;
    transition: background 0.1s;
}
.cal-slot:last-child { border-right: 0; }
.cal-slot:hover { background: #FFFDE7; }
.cal-slot.drop-hover { background: #FFEB3B; box-shadow: inset 0 0 0 2px var(--black); }

.cal-slot-add {
    opacity: 0;
    align-self: stretch;
    border: 1px dashed var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 14px; font-weight: 700;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.12s, background 0.1s, border-color 0.1s;
}
.cal-slot:hover .cal-slot-add { opacity: 1; }
.cal-slot-add:hover { background: var(--yellow); border-color: var(--yellow); color: var(--black); }

/* Bulle = 1 publication */
.cal-bubble {
    background: var(--bg, #F5F5F5);
    color: var(--fg, #000);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    display: flex; align-items: center; gap: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.05s, box-shadow 0.1s, border-color 0.1s;
    position: relative;
    line-height: 1.3;
}
.cal-bubble:hover {
    border-color: var(--fg);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.cal-bubble.statut-publie {
    background: linear-gradient(to right, var(--bg) 0%, #E9F7EF 100%);
    border: 1px solid #A9D9BB;
}
.cal-bubble.statut-idee {
    opacity: 0.65;
}
.cal-bubble-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--fg);
    flex-shrink: 0;
}
.cal-bubble-text {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap;
}
.cal-bubble-status {
    font-size: 10px; flex-shrink: 0;
}
.cal-bubble-status.publie { color: var(--ok); font-size: 14px; }
.cal-bubble-link {
    position: absolute;
    right: 6px; top: 50%;
    transform: translateY(-50%);
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ok); color: #fff;
    border-radius: 3px; font-size: 12px; font-weight: 900;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.12s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 2;
}
.cal-bubble:hover .cal-bubble-link { opacity: 1; }
.cal-bubble-link:hover { background: #026e41; }
.cal-bubble-link-missing {
    background: var(--warn) !important;
    cursor: help;
}
.cal-bubble-link-missing:hover { background: #B5550D !important; }
/* Au hover, masque le ✓ et la rognure pour laisser place à l'icône */
.cal-bubble:hover .cal-bubble-status { opacity: 0; }
.cal-bubble:hover .cal-bubble-text { padding-right: 22px; }

/* Legacy .calendar-toolbar */
.calendar-toolbar {
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
    background: var(--surface); padding: 14px 16px; border-radius: var(--radius);
    margin-bottom: 18px;
}
.year-switcher { display: flex; gap: 4px; }
.year-switcher a {
    padding: 8px 14px; border-radius: 4px;
    background: var(--white); border: 1px solid var(--border);
    font-weight: 700; font-size: 13px;
}
.year-switcher a.active { background: var(--yellow); border-color: var(--black); color: var(--black); box-shadow: 0 2px 0 var(--black); }

.month-block {
    margin-bottom: 14px;
    scroll-margin-top: 160px;
}
.month-title {
    font-size: 20px; font-weight: 900;
    padding: 12px 18px; background: var(--yellow); color: var(--black);
    border-radius: var(--radius);
    display: flex; justify-content: space-between; align-items: center;
    letter-spacing: 0.5px;
    width: 100%; border: 0;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}
.month-title:hover { background: var(--yellow-dark); }
.month-block.is-open .month-title { border-radius: var(--radius) var(--radius) 0 0; }
.month-title-left { display: flex; align-items: center; gap: 12px; }
.month-chevron {
    display: inline-block;
    transform: rotate(-90deg);
    transition: transform 0.15s;
    font-size: 16px;
}
.month-block.is-open .month-chevron { transform: rotate(0deg); }
.month-count {
    font-size: 12px; font-weight: 700;
    background: rgba(0,0,0,0.12); color: #000;
    padding: 2px 8px; border-radius: 10px;
    letter-spacing: 0;
}
.month-title .month-actions { display: flex; gap: 6px; }
.month-title .btn-sm { font-size: 12px; padding: 6px 12px; background: var(--white); color: var(--black); border: 0; }
.month-title .btn-sm:hover { background: var(--black); color: var(--yellow); }

.month-body { display: none; }
.month-block.is-open .month-body { display: block; }

/* Barre de portée — filtre Année/Mois/Semaine/Jour */
.scope-bar {
    position: sticky; top: 70px; z-index: 20;
    display: flex; gap: 10px; flex-wrap: wrap;
    padding: 12px 14px; margin-bottom: 16px;
    background: var(--yellow);
    border-radius: var(--radius);
    align-items: center;
    box-shadow: 0 4px 16px rgba(255, 221, 0, 0.35);
    border: 2px solid var(--black);
}
.scope-modes {
    display: flex; gap: 2px; background: var(--black); padding: 3px;
    border-radius: 6px;
}
.scope-btn {
    padding: 6px 14px; border: 0;
    background: transparent; color: var(--yellow);
    border-radius: 4px; font-size: 13px; font-weight: 700;
    font-family: inherit; cursor: pointer;
}
.scope-btn:hover { background: rgba(255,255,255,0.1); }
.scope-btn.is-active { background: var(--yellow); color: var(--black); }
.scope-sep { width: 1px; height: 24px; background: rgba(0,0,0,0.2); }
.scope-picker {
    padding: 7px 10px; border: 1px solid var(--black);
    background: var(--white); color: var(--black);
    border-radius: 4px; font-weight: 700; font-size: 13px;
    min-width: 180px;
}
.scope-summary {
    font-size: 12px; font-weight: 700; color: var(--black);
}

/* Mini-navigation mois — legacy (non utilisée) */
.month-nav {
    position: sticky; top: 78px; z-index: 20;
    display: flex; gap: 4px; flex-wrap: wrap;
    padding: 10px 12px; margin-bottom: 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 4px solid var(--yellow);
    border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    align-items: center;
}
.month-nav-btn {
    padding: 5px 10px; border: 1px solid var(--border);
    background: var(--white); border-radius: 4px;
    font-size: 12px; font-weight: 700;
    font-family: inherit; cursor: pointer;
}
.month-nav-btn:hover { background: var(--yellow); border-color: var(--yellow); }
.month-nav-sep {
    width: 1px; height: 20px; background: var(--border); margin: 0 4px;
}
.month-nav-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 20px;
    background: var(--surface); font-size: 12px; font-weight: 700;
    border: 1px solid var(--border);
    transition: all 0.15s;
}
.month-nav-pill:hover { background: var(--yellow); border-color: var(--yellow); color: #000; }
.month-nav-pill.is-current {
    background: var(--yellow); border-color: var(--black); color: #000;
    box-shadow: 0 2px 0 var(--black);
}
.month-nav-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 18px; padding: 0 5px;
    background: var(--black); color: var(--yellow);
    border-radius: 9px; font-size: 10px; font-weight: 900;
}
.month-nav-pill:hover .month-nav-count,
.month-nav-pill.is-current .month-nav-count { background: var(--black); color: var(--yellow); }

/* Semaine courante mise en avant */
.week-wrapper.is-current-week {
    border-color: var(--black);
    box-shadow: 0 0 0 2px var(--yellow);
}
.week-wrapper.is-current-week .wh-week::before {
    content: '●'; color: var(--black); margin-right: 3px;
}

.week-actions {
    padding: 6px 12px; background: var(--surface);
    display: flex; gap: 8px; font-size: 12px; align-items: center;
    border-top: 1px dashed var(--border);
}
.week-actions .link-btn { color: var(--black); font-weight: 700; }

.week-wrapper {
    background: var(--white);
    border: 1px solid var(--border);
    border-top: 0;
}

.week-wrapper + .week-wrapper {
    border-top: 0;
}

.week-header {
    display: grid;
    grid-template-columns: 120px repeat(5, 1fr);
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    font-weight: 700; font-size: 12px;
}
.week-header > div {
    padding: 10px 12px;
    border-right: 1px solid var(--border);
}
.week-header .wh-week {
    background: var(--yellow); color: var(--black);
    font-weight: 900; font-size: 13px;
}
.week-header .wh-theme { text-align: center; }
.week-header .wh-theme-label { display: block; font-size: 13px; }
.week-header .wh-theme-value { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 400; }

.week-events {
    padding: 8px 14px;
    background: #FFF9D9;
    border-bottom: 1px dashed var(--yellow);
    font-size: 12px;
    display: flex; gap: 8px; flex-wrap: wrap;
}
.week-events:empty { display: none; }

.grid-row {
    display: grid;
    grid-template-columns: 120px repeat(5, 1fr);
    border-bottom: 1px solid var(--border);
}
.grid-row:last-child { border-bottom: 0; }
.grid-row .channel-cell {
    padding: 10px 12px; font-weight: 700; font-size: 13px;
    background: var(--surface); border-right: 1px solid var(--border);
    display: flex; align-items: center;
}
.cell {
    position: relative;
    border-right: 1px solid var(--border);
    padding: 6px;
    min-height: 50px;
    transition: background 0.1s;
}
.cell:last-child { border-right: 0; }
.cell:hover { background: #FFFCE8; }
.cell textarea {
    width: 100%; height: 100%; min-height: 38px;
    border: 0; background: transparent;
    resize: none; font-size: 13px; font-family: var(--font);
    color: var(--black); padding: 2px;
    line-height: 1.35;
}
.cell textarea:focus { outline: 2px solid var(--yellow); background: var(--white); }
.cell-meta {
    display: flex; gap: 6px; align-items: center;
    margin-top: 4px; opacity: 0.7;
    font-size: 11px;
}
.cell.is-filled { background: #FFFDE7; }
.cell.is-publie { background: #E9F7EF; }
.cell-save-indicator {
    position: absolute; top: 4px; right: 4px;
    width: 6px; height: 6px; border-radius: 50%;
    background: transparent;
    transition: background 0.2s;
}
.cell.saving .cell-save-indicator { background: var(--warn); }
.cell.saved  .cell-save-indicator { background: var(--ok); }
.cell.error  .cell-save-indicator { background: var(--danger); }
.cell-status-pill {
    position: absolute; bottom: 4px; left: 4px;
    font-size: 9px; font-weight: 700;
    padding: 1px 6px; border-radius: 8px;
    text-transform: uppercase;
}
.cell-post-link, .cell-projet-link {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ok); color: #fff;
    border-radius: 3px; font-size: 12px; font-weight: 900;
    text-decoration: none;
    z-index: 3;
    line-height: 1;
}
.cell-projet-link {
    right: 30px; background: var(--black); color: var(--yellow);
}
.cell-post-link:hover { background: #026e41; }
.cell-projet-link:hover { background: #333; }

.cell-drag-handle {
    position: absolute; top: 4px; left: 4px;
    width: 18px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--yellow); color: var(--black);
    border-radius: 3px;
    font-size: 10px; font-weight: 900;
    cursor: grab;
    opacity: 0;
    transition: opacity 0.12s;
    z-index: 2;
    user-select: none;
    line-height: 1;
}
.cell:hover .cell-drag-handle { opacity: 1; }
.cell-drag-handle:hover { background: var(--yellow-dark); }
.cell-drag-handle:active { cursor: grabbing; }
.cell.is-moving { opacity: 0.3; }

/* Login screen — fond jaune, carte blanche */
.login-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--yellow);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.login-wrapper::before {
    content: ''; position: absolute;
    width: 600px; height: 600px; border-radius: 50%;
    background: rgba(0,0,0,0.03);
    top: -200px; right: -200px;
}
.login-card {
    width: 100%; max-width: 440px;
    background: var(--white);
    padding: 44px 36px;
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.18);
    position: relative;
    z-index: 1;
}
.login-card h1 { margin-bottom: 8px; font-size: 36px; }
.login-card .subtitle { margin-bottom: 28px; }
.login-card button { width: 100%; justify-content: center; padding: 14px; font-size: 15px; }

/* Command palette */
.cmdk-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 100; display: none;
    align-items: flex-start; justify-content: center;
    padding-top: 10vh;
}
.cmdk-overlay.open { display: flex; }
.cmdk-panel {
    width: 100%; max-width: 640px;
    background: var(--white); border-radius: 10px;
    border-top: 4px solid var(--yellow);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    overflow: hidden;
}
.cmdk-input {
    width: 100%; padding: 18px 20px;
    border: 0; outline: 0;
    font-size: 16px; font-family: var(--font);
    background: var(--white); color: var(--black);
    border-bottom: 1px solid var(--border);
}
.cmdk-results { max-height: 50vh; overflow-y: auto; }
.cmdk-group-title {
    padding: 10px 20px 4px; font-size: 11px;
    text-transform: uppercase; font-weight: 700;
    color: var(--muted); letter-spacing: 1px;
}
.cmdk-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px; font-size: 14px;
    cursor: pointer; border-left: 3px solid transparent;
}
.cmdk-item:hover, .cmdk-item.active {
    background: #FFFCE8; border-left-color: var(--yellow);
}
.cmdk-item-type {
    font-size: 11px; color: var(--muted);
    text-transform: uppercase; font-weight: 700;
}
.cmdk-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }

/* ===== Responsive ===== */

/* Tablette */
@media (max-width: 1100px) {
    .topbar-inner { gap: 12px; padding: 10px 14px; flex-wrap: wrap; }
    .main-nav a { padding: 6px 10px; font-size: 13px; }
    .brand-name { font-size: 14px; }
    .page { padding: 20px 14px 60px; }
    h1 { font-size: 28px; }
    .month-nav { top: 0; }
    .scope-bar { top: 0; flex-wrap: wrap; }
    .year-switcher { flex-wrap: wrap; }
}

/* Mobile */
@media (max-width: 720px) {
    /* Topbar compactée + burger menu */
    .topbar { border-bottom-width: 3px; }
    .topbar-inner { gap: 10px; padding: 10px 12px; flex-wrap: nowrap; }
    .nav-burger { display: flex; }
    .brand-name { display: none; }
    .desktop-only { display: none !important; }

    /* Nav devient drawer caché par défaut */
    .main-nav {
        position: fixed; top: 0; left: 0; bottom: 0;
        width: 280px; max-width: 80vw;
        background: var(--white);
        border-right: 4px solid var(--yellow);
        box-shadow: 8px 0 24px rgba(0,0,0,0.15);
        padding: 24px 18px 18px;
        display: flex; flex-direction: column; gap: 4px;
        overflow-y: auto;
        z-index: 50;
        transform: translateX(-105%);
        transition: transform 0.22s ease-out;
    }
    .main-nav.is-open { transform: translateX(0); }
    .main-nav a {
        padding: 12px 14px;
        font-size: 15px;
        border-radius: 6px;
        border-left: 3px solid transparent;
    }
    .main-nav a.active { border-left-color: var(--black); }
    .main-nav a.nav-help { border: 1px dashed var(--black); margin-top: 8px; }
    .nav-mobile-user {
        display: block;
        margin-top: auto; padding-top: 18px;
        border-top: 2px dashed var(--border);
    }
    .nav-mobile-user-info {
        display: flex; align-items: center; gap: 10px;
        margin-bottom: 12px;
    }

    .topbar-right { margin-left: auto; }
    .icon-btn { padding: 6px 8px; }
    .icon-btn .kbd { display: none; }

    /* Page */
    .page { padding: 14px 10px 40px; }
    h1 { font-size: 24px; }
    .subtitle { font-size: 13px; }

    /* Grids → 1 col */
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 12px; }
    .flex-between { flex-direction: column; align-items: flex-start; gap: 8px; }

    /* Calendrier : scroll horizontal de la grille */
    .calendar-toolbar { flex-direction: column; align-items: stretch; }
    .calendar-toolbar > label { width: 100%; }
    .scope-bar { flex-direction: column; align-items: stretch; padding: 10px; }
    .scope-modes { width: 100%; justify-content: space-between; }
    .scope-btn { flex: 1; padding: 6px 8px; font-size: 12px; }
    .scope-picker { width: 100%; }
    .scope-sep { display: none; }
    .scope-summary { text-align: center; }

    /* Calendrier mobile : liste de cartes verticales (plus de scroll horizontal) */
    .month-block { overflow: visible; }

    .week-wrapper {
        border-radius: var(--radius);
        margin-bottom: 14px;
        overflow: hidden;
    }
    .week-wrapper.is-current-week {
        box-shadow: 0 0 0 3px var(--yellow);
    }

    /* Entête semaine (S17 + dates) occupe toute la ligne */
    .week-header {
        display: block;
        min-width: 0;
        padding: 0;
        background: var(--yellow);
    }
    .week-header > div { display: none; }
    .week-header .wh-week {
        display: block;
        padding: 10px 14px;
        font-weight: 900; font-size: 16px;
        border: 0;
    }
    .week-header .wh-week br { display: none; }
    .week-header .wh-week span { margin-left: 8px; font-size: 13px; opacity: 0.7; }

    /* Chaque canal devient une section avec ses 5 thèmes en cartes */
    .grid-row {
        display: block;
        min-width: 0;
        background: var(--white);
        border-bottom: 1px solid var(--border);
    }
    .grid-row .channel-cell {
        display: block;
        background: var(--black);
        color: var(--yellow);
        padding: 8px 14px;
        font-weight: 900; font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border: 0;
    }

    /* Cellules : cartes pleines largeur avec label thème */
    .cell {
        display: block;
        min-height: auto;
        padding: 10px 14px;
        border: 0;
        border-bottom: 1px solid var(--border);
    }
    .cell:last-child { border-bottom: 0; }

    /* Label thème injecté via ::before */
    .cell::before {
        content: attr(data-theme-label) " · " attr(data-theme-valeur);
        display: block;
        font-size: 10px; font-weight: 900;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        color: var(--muted);
        margin-bottom: 4px;
    }

    /* Cellules vides : compactes, tap pour agrandir */
    .cell.is-empty {
        padding: 8px 14px;
        background: #FAFAFA;
    }
    .cell.is-empty textarea {
        min-height: 0; height: 32px;
        font-style: italic; color: var(--muted);
    }

    /* Cellules remplies : mise en avant */
    .cell.is-filled {
        background: #FFFDE7;
        padding: 12px 14px;
    }
    .cell.is-filled.is-publie { background: #E9F7EF; }

    .cell textarea {
        min-height: 48px;
        font-size: 14px; line-height: 1.4;
    }

    /* Badge statut positionné normalement en bas */
    .cell-status-pill {
        position: static; display: inline-block; margin-top: 6px;
    }
    .cell-save-indicator {
        top: 8px; right: 8px;
    }

    /* Actions semaine pleine largeur */
    .week-actions {
        padding: 10px 14px;
        justify-content: space-between;
    }

    /* Masquer le drawer backlog qui prend trop de place → utiliser overlay */
    .backlog-drawer { width: 100vw; max-width: 100vw; }
    body.drawer-open .page { padding-right: 10px; }

    /* Login */
    .login-card { padding: 28px 22px; }
    .login-card h1 { font-size: 28px; }

    /* Dashboard */
    .stat { padding: 14px 16px; }
    .stat-value { font-size: 28px; }

    /* Tables */
    table { font-size: 12px; }
    th, td { padding: 6px 8px; }

    /* Footer */
    .site-footer-inner { flex-direction: column; text-align: center; gap: 12px; }

    /* Command palette */
    .cmdk-panel { max-width: 95vw; margin: 0 2.5vw; }

    /* Guide */
    .guide-hero { padding: 24px 20px; flex-direction: column; align-items: flex-start; }
    .guide-hero h1 { font-size: 30px; }
    .guide-step { flex-direction: column; gap: 12px; margin-bottom: 32px; }
    .guide-step-num { width: 44px; height: 44px; font-size: 20px; }
    .guide-toc { top: 56px; padding: 10px; overflow-x: auto; flex-wrap: nowrap; }
    .guide-toc a { flex-shrink: 0; }
}

/* Modal d'édition de cellule */
.cell-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 90; display: none;
    align-items: flex-start; justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}
.cell-modal-overlay.is-open { display: flex; }
.cell-modal-panel {
    width: 100%; max-width: 980px;
    background: var(--white);
    border-radius: 10px;
    border-top: 6px solid var(--yellow);
    box-shadow: 0 30px 80px rgba(0,0,0,0.3);
    display: flex; flex-direction: column;
    max-height: calc(100vh - 80px);
}
.cell-modal-head {
    padding: 18px 24px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border);
}
.cell-modal-ctx {
    font-size: 11px; font-weight: 900;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--muted);
    margin-bottom: 4px;
}
.cell-modal-body {
    flex: 1; overflow-y: auto;
    padding: 20px 24px;
}
.cell-modal-grid {
    display: grid; grid-template-columns: 2fr 1fr; gap: 20px;
}
@media (max-width: 780px) {
    .cell-modal-grid { grid-template-columns: 1fr; }
    .cell-modal-panel { max-width: 100%; }
    .cell-modal-body { padding: 14px 16px; }
}
.cell-modal-foot {
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    display: flex; gap: 10px; align-items: center;
    border-radius: 0 0 10px 10px;
}
/* Onglets dans modal cellule */
.cell-modal-tabs {
    display: flex; gap: 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.cm-tab {
    flex: 1;
    padding: 14px 18px;
    background: transparent; border: 0;
    border-bottom: 3px solid transparent;
    font-weight: 900; font-size: 14px;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.12s, background 0.12s, border-color 0.12s;
    font-family: inherit;
}
.cm-tab:hover { background: var(--white); color: var(--black); }
.cm-tab.is-active {
    background: var(--white);
    color: var(--black);
    border-bottom-color: var(--yellow);
}
.cm-tab-panel { display: none; }
.cm-tab-panel.is-active { display: block; }

.statut-picker {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.statut-picker label {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    background: var(--surface);
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 400;
}
.statut-picker label:has(input:checked) {
    border-color: var(--black);
    background: var(--white);
}
.statut-picker input[type=radio] { cursor: pointer; }

/* Cellule en mode "verrouillée" pour cliquer — on n'utilise plus textarea */
.cell.is-publie .cell-input { cursor: not-allowed; background: transparent; }

/* Print */
@media print {
    .topbar, .cmdk-overlay, .no-print, .icon-btn, form button { display: none !important; }
    body { background: var(--white); }
    .cell { background: var(--white) !important; }
    .month-block { page-break-after: always; }
    .page { padding: 0; max-width: none; }
}

/* Backlog drawer — panneau latéral drag-source */
.backlog-drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 320px; max-width: 90vw;
    background: var(--white);
    border-left: 4px solid var(--yellow);
    box-shadow: -8px 0 24px rgba(0,0,0,0.15);
    z-index: 80;
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.2s;
}
.backlog-drawer.is-open { transform: translateX(0); }
.backlog-drawer-head {
    padding: 14px 16px;
    background: var(--yellow); color: #000;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 15px;
}
.backlog-drawer-head .link-btn { color: #000; text-decoration: none; font-size: 18px; padding: 0 8px; }
.backlog-drawer-body {
    flex: 1; overflow-y: auto; padding: 14px;
}
.backlog-drawer-body input[type="search"] {
    width: 100%; padding: 8px 10px;
    border: 1px solid var(--border); border-radius: 4px;
    font-family: var(--font); font-size: 13px;
}
.backlog-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.backlog-item {
    padding: 8px 10px;
    background: var(--surface);
    border-left: 3px solid var(--yellow);
    border-radius: 4px;
    cursor: grab;
    font-size: 12px;
    display: flex; align-items: flex-start; gap: 6px;
    transition: transform 0.1s, box-shadow 0.1s;
}
.backlog-item:hover {
    transform: translateX(-2px);
    box-shadow: -2px 2px 8px rgba(0,0,0,0.08);
}
.backlog-item:active { cursor: grabbing; }
.backlog-item.dragging { opacity: 0.4; }
.backlog-item-cat {
    font-size: 9px; font-weight: 900; text-transform: uppercase;
    background: var(--black); color: var(--yellow);
    padding: 1px 5px; border-radius: 3px;
    flex-shrink: 0; letter-spacing: 0.5px;
}
.backlog-item-lib { flex: 1; line-height: 1.35; }
.backlog-item-note { opacity: 0.6; font-size: 11px; }

body.drawer-open .page { padding-right: 340px; }

/* Drop target sur cellule */
.cell.drop-hover {
    background: #FFEB3B !important;
    box-shadow: inset 0 0 0 2px var(--black);
}

/* Nav Guide — bouton aide distinctif */
.main-nav a.nav-help {
    background: var(--surface);
    color: var(--black);
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px dashed var(--black);
}
.main-nav a.nav-help:hover { background: var(--yellow); border-color: var(--yellow); }
.main-nav a.nav-help.active { background: var(--yellow); border-color: var(--yellow); }
.nav-help-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; background: var(--black); color: var(--yellow);
    border-radius: 50%; font-size: 11px; font-weight: 900;
}

/* Guide page */
.guide-hero {
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; flex-wrap: wrap;
    background: var(--yellow); color: var(--black);
    padding: 36px 40px; border-radius: 12px;
    margin-bottom: 24px;
}
.guide-hero h1 { margin: 0; font-size: 42px; }
.guide-hero .subtitle { color: var(--black); opacity: 0.7; margin: 8px 0 0; font-size: 15px; }
.guide-hero-right { display: flex; align-items: center; gap: 12px; }
.guide-hero .btn { background: var(--black); color: var(--yellow); }
.guide-hero .btn:hover { background: #333; }
.guide-step-badge {
    display: inline-block; padding: 6px 14px;
    background: var(--white); color: var(--black);
    border-radius: 20px; font-weight: 700; font-size: 13px;
}

.guide-toc {
    display: flex; gap: 10px; flex-wrap: wrap;
    padding: 14px 16px; background: var(--surface);
    border-radius: var(--radius); margin-bottom: 32px;
    position: sticky; top: 70px; z-index: 10;
    border-left: 4px solid var(--yellow);
}
.guide-toc a {
    padding: 6px 12px; background: var(--white);
    border-radius: 20px; font-size: 13px; font-weight: 700;
    border: 1px solid var(--border);
}
.guide-toc a:hover { background: var(--yellow); border-color: var(--yellow); }

.guide-step {
    display: flex; gap: 24px; align-items: flex-start;
    margin-bottom: 48px;
    scroll-margin-top: 130px;
}
.guide-step-num {
    flex-shrink: 0;
    width: 60px; height: 60px;
    background: var(--yellow); color: var(--black);
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; font-weight: 900; font-size: 26px;
    box-shadow: 0 4px 12px rgba(255, 221, 0, 0.4);
}
.guide-step-body { flex: 1; min-width: 0; }
.guide-step-body h2 { margin-top: 0; font-size: 26px; }
.guide-step-body > p { font-size: 15px; line-height: 1.6; }

.guide-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px; margin-top: 20px;
}
.guide-card {
    padding: 18px 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-top: 3px solid var(--yellow);
}
.guide-card-icon { font-size: 28px; margin-bottom: 6px; }
.guide-card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 900; }
.guide-card p { font-size: 13px; line-height: 1.5; color: var(--black); margin: 0; }

.guide-list { margin: 16px 0 0 20px; }
.guide-list li { margin-bottom: 6px; font-size: 14px; }

/* Mock grille pédagogique */
.guide-mock {
    margin: 20px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.guide-mock-header, .guide-mock-row {
    display: grid; grid-template-columns: 90px repeat(5, 1fr);
}
.guide-mock-header > div, .guide-mock-row > div {
    padding: 8px 10px; font-size: 11px; border-right: 1px solid var(--border);
}
.guide-mock-week {
    background: var(--yellow); color: var(--black);
    font-weight: 900;
}
.guide-mock-theme {
    background: var(--surface); font-weight: 700;
    text-align: center;
}
.guide-mock-events {
    padding: 6px 12px; background: #FFF9D9;
    font-size: 11px; border-bottom: 1px dashed var(--yellow);
}
.guide-mock-row {
    border-top: 1px solid var(--border);
}
.guide-mock-canal {
    background: var(--surface); font-weight: 700;
    display: flex; align-items: center;
}
.guide-mock-cell {
    min-height: 60px; font-size: 11px;
    display: flex; flex-direction: column; gap: 4px;
    color: var(--muted);
}
.guide-mock-cell.is-filled { background: #FFFDE7; color: var(--black); }
.guide-mock-cell.is-publie { background: #E9F7EF; }
.guide-mock-pill {
    display: inline-block; padding: 1px 6px;
    font-size: 9px; font-weight: 700;
    background: #FEF4E6; color: var(--warn);
    border-radius: 8px; text-transform: uppercase; letter-spacing: 0.5px;
    align-self: flex-start;
}
.guide-mock-pill.publie { background: #E6F6EE; color: var(--ok); }

.guide-table {
    margin-top: 20px;
}
.guide-table td { vertical-align: top; }
.guide-table td:first-child { width: 180px; }

.kbd-light {
    display: inline-block; padding: 1px 6px;
    font-size: 11px; font-weight: 700;
    background: var(--black); color: var(--yellow);
    border-radius: 3px;
    font-family: ui-monospace, SFMono-Regular, monospace;
}

.guide-faq {
    padding: 14px 18px; border: 1px solid var(--border);
    border-left: 4px solid var(--yellow);
    border-radius: 6px; margin-bottom: 10px;
    background: var(--white);
}
.guide-faq summary {
    cursor: pointer; font-weight: 700; font-size: 15px;
    list-style: none;
    display: flex; align-items: center; gap: 8px;
}
.guide-faq summary::before {
    content: '+'; display: inline-block;
    width: 20px; height: 20px; background: var(--yellow); color: var(--black);
    border-radius: 50%; text-align: center; line-height: 20px; font-weight: 900;
    flex-shrink: 0;
}
.guide-faq[open] summary::before { content: '−'; }
.guide-faq p { margin: 10px 0 0 28px; font-size: 14px; color: var(--muted); line-height: 1.6; }

/* Petits utilitaires */
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 16px; }
.text-muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.nowrap { white-space: nowrap; }
.pill {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    background: var(--surface); font-size: 11px; font-weight: 700;
}
.hidden { display: none !important; }
.small { font-size: 12px; color: var(--muted); }
