/* ═══════════════════════════════════════════════════════════
   FRENCHWAVE — Feuille de style globale
   Thème sombre par défaut, thème clair via [data-theme="light"]
   ═══════════════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* ══════════════════════════════════════════
   Variables — Thème sombre (défaut)
   ══════════════════════════════════════════ */
:root {
    color-scheme: dark;

    /* Palettes inversées : --white = texte clair / CTA bg, --black = fond sombre / CTA texte */
    --black:  #0a0a0a;
    --white:  #f0f0f0;

    /* Surfaces */
    --surface:          #111111;
    --surface-2:        #181818;
    --surface-elevated: #1a1a1a;
    --topnav-bg:        #0d0d0d;
    --dropdown-bg:      #1a1a1a;
    --suggestions-bg:   #1e1e1e;

    /* Texte */
    --grey:       #666666;
    --grey-light: #999999;

    /* Bordures */
    --border:       rgba(255,255,255,0.07);
    --border-mid:   rgba(255,255,255,0.12);
    --border-focus: rgba(255,255,255,0.30);
    --border-strong:rgba(255,255,255,0.50);

    /* Accent — actif (vert) */
    --active:        #4ade80;
    --active-bg:     rgba(74,222,128,0.08);
    --active-border: rgba(74,222,128,0.20);
    --active-border-strong: rgba(74,222,128,0.35);
    --active-glow:   0 0 6px #4ade80;

    /* Accent — brouillon (ambre) */
    --draft:        #fbbf24;
    --draft-bg:     rgba(251,191,36,0.08);
    --draft-border: rgba(251,191,36,0.30);

    /* Autres statuts */
    --archived: #444444;
    --error:    #e05a5a;
    --danger:   #f87171;
    --danger-bg:     rgba(248,113,113,0.06);
    --danger-border: rgba(248,113,113,0.30);

    /* Ombres & overlays */
    --modal-backdrop: rgba(0,0,0,0.60);
    --modal-shadow:   0 24px 60px rgba(0,0,0,0.70);
    --dropdown-shadow:0 12px 40px rgba(0,0,0,0.55);

    /* Fonds flottants */
    --hover-bg:        rgba(255,255,255,0.03);
    --hover-bg-strong: rgba(255,255,255,0.04);
    --weekend-bg:      rgba(255,255,255,0.015);
    --cycle-active-bg: rgba(74,222,128,0.04);
    --sortable-over-bg:rgba(255,255,255,0.03);
    --occupied-bg:     rgba(255,255,255,0.03);
}

/* ══════════════════════════════════════════
   Variables — Thème clair
   ══════════════════════════════════════════ */
[data-theme="light"] {
    color-scheme: light;

    /* Inversion : --white = texte sombre / CTA bg sombre, --black = fond clair / CTA texte clair */
    --black:  #f0f0f0;
    --white:  #111111;

    --surface:          #ffffff;
    --surface-2:        #f2f2f2;
    --surface-elevated: #ffffff;
    --topnav-bg:        #fafafa;
    --dropdown-bg:      #ffffff;
    --suggestions-bg:   #ffffff;

    --grey:       #888888;
    --grey-light: #555555;

    --border:        rgba(0,0,0,0.09);
    --border-mid:    rgba(0,0,0,0.15);
    --border-focus:  rgba(0,0,0,0.25);
    --border-strong: rgba(0,0,0,0.40);

    --active:        #15803d;
    --active-bg:     rgba(21,128,61,0.08);
    --active-border: rgba(21,128,61,0.22);
    --active-border-strong: rgba(21,128,61,0.38);
    --active-glow:   0 0 6px rgba(21,128,61,0.4);

    --draft:        #b45309;
    --draft-bg:     rgba(180,83,9,0.07);
    --draft-border: rgba(180,83,9,0.28);

    --archived: #aaaaaa;
    --error:    #dc2626;
    --danger:   #dc2626;
    --danger-bg:     rgba(220,38,38,0.05);
    --danger-border: rgba(220,38,38,0.25);

    --modal-backdrop:  rgba(0,0,0,0.35);
    --modal-shadow:    0 24px 60px rgba(0,0,0,0.15);
    --dropdown-shadow: 0 12px 40px rgba(0,0,0,0.12);

    --hover-bg:        rgba(0,0,0,0.03);
    --hover-bg-strong: rgba(0,0,0,0.05);
    --weekend-bg:      rgba(0,0,0,0.018);
    --cycle-active-bg: rgba(21,128,61,0.04);
    --sortable-over-bg:rgba(0,0,0,0.03);
    --occupied-bg:     rgba(0,0,0,0.03);
}

/* ══════════════════════════════════════════
   Base
   ══════════════════════════════════════════ */
html, body {
    height: 100%;
    background: var(--black);
    color: var(--white);
    font-family: 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════
   Bouton de changement de thème
   ══════════════════════════════════════════ */
.btn-theme {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: none;
    border: 1px solid var(--border-mid);
    border-radius: 2px;
    color: var(--grey);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.btn-theme:hover { color: var(--white); border-color: var(--border-focus); }
.btn-theme svg   { width: 14px; height: 14px; }

/* Sombre → icône soleil visible (pour passer au clair) */
.btn-theme .icon-moon { display: none; }
.btn-theme .icon-sun  { display: block; }

/* Clair → icône lune visible (pour passer au sombre) */
[data-theme="light"] .btn-theme .icon-sun  { display: none; }
[data-theme="light"] .btn-theme .icon-moon { display: block; }

/* ══════════════════════════════════════════
   Layout global
   ══════════════════════════════════════════ */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ══════════════════════════════════════════
   Header public (home + login)
   ══════════════════════════════════════════ */
.page > header {
    display: flex;
    align-items: center;
    padding: 1.5rem 2.5rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

.page > header .header-end {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--white);
}

.header-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--grey);
    margin-left: auto;
}

/* ── Bouton connexion (home) ── */
.btn-login {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--white);
    border: 1px solid var(--border);
    padding: 0.55rem 1.2rem;
    border-radius: 2px;
    text-decoration: none;
    transition: border-color 0.2s, opacity 0.2s;
    opacity: 0.6;
}

.btn-login:hover { border-color: var(--border-focus); opacity: 0.85; }

/* ── Hero ── */
.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 2rem;
    gap: 2rem;
}

.hero-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--grey);
}

.hero-title {
    font-size: clamp(3.5rem, 12vw, 9rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
    text-transform: uppercase;
}

.hero-tagline {
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    color: var(--grey);
    max-width: 36ch;
    line-height: 1.7;
}

.divider {
    width: 1px;
    height: 60px;
    background: var(--border);
    margin: 0 auto;
}

/* ── Bouton Instagram ── */
.btn-instagram {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.5rem;
    padding: 0.85rem 1.8rem;
    background: var(--white);
    color: var(--black);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 2px;
    transition: opacity 0.2s;
}

.btn-instagram:hover { opacity: 0.85; }
.btn-instagram svg   { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Footer public ── */
.page > footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--grey);
    border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════════
   Formulaire de connexion
   ══════════════════════════════════════════ */
.login-card {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.login-header               { display: flex; flex-direction: column; gap: 0.4rem; }
.login-header h1            { font-size: 1.6rem; font-weight: 900; letter-spacing: -0.02em; text-transform: uppercase; }
.login-header p             { font-size: 0.8rem; color: var(--grey); letter-spacing: 0.04em; }

.alert-error {
    font-size: 0.78rem;
    color: var(--error);
    border: 1px solid rgba(224,90,90,0.3);
    padding: 0.75rem 1rem;
    border-radius: 2px;
    letter-spacing: 0.02em;
}

.back-link           { text-align: center; font-size: 0.72rem; color: var(--grey); letter-spacing: 0.06em; }
.back-link a         { color: var(--white); text-decoration: none; border-bottom: 1px solid var(--border); padding-bottom: 1px; transition: border-color 0.2s; }
.back-link a:hover   { border-color: var(--white); }

/* ══════════════════════════════════════════
   Formulaires (champs)
   ══════════════════════════════════════════ */
.form-fields { display: flex; flex-direction: column; gap: 1rem; }

.field                { display: flex; flex-direction: column; gap: 0.4rem; }
.field label,
label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--grey);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea,
select {
    background: var(--surface);
    border: 1px solid var(--border-mid);
    color: var(--white);
    padding: 0.75rem 0.9rem;
    font-size: 0.9rem;
    font-family: inherit;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    border-color: var(--border-focus);
}

input[type="email"]::placeholder,
input[type="password"]::placeholder,
input[type="text"]::placeholder,
input[type="url"]::placeholder,
textarea::placeholder {
    color: var(--grey);
}

textarea { resize: vertical; }
select   { appearance: none; cursor: pointer; }
select option { background: var(--surface-elevated); }

.field-hint   { font-size: 0.68rem; color: var(--grey); letter-spacing: 0.03em; }
.field-errors { display: flex; flex-direction: column; gap: 0.25rem; }
.field-error  { font-size: 0.7rem; color: var(--error); letter-spacing: 0.03em; }

.char-counter           { font-size: 0.65rem; color: var(--grey); text-align: right; letter-spacing: 0.04em; transition: color 0.15s; }
.char-counter.near-limit{ color: var(--draft); }
.char-counter.at-limit  { color: var(--error); }

.select-wrapper          { position: relative; }
.select-wrapper::after   {
    content: '';
    position: absolute;
    right: 1rem; top: 50%; transform: translateY(-50%);
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--grey);
    pointer-events: none;
}

/* ── Form group (modaux) ── */
.form-group              { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label        { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey); }

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    background: var(--surface);
    border: 1px solid var(--border-mid);
    border-radius: 8px;
    color: var(--white);
    font-size: 0.8rem;
    padding: 0.55rem 0.75rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s;
    font-family: inherit;
}

.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--border-focus);
}

.form-group textarea { resize: none; overflow-y: hidden; }
.form-group select   { appearance: none; cursor: pointer; }
.form-group .form-error { font-size: 0.7rem; color: var(--danger); margin-top: 0.2rem; }

/* Page de création de programmation */
.form-page                { max-width: 600px; }
.form-header              { margin-bottom: 2.5rem; }
.form-title               { font-size: 1.4rem; font-weight: 900; letter-spacing: -0.02em; text-transform: uppercase; }

.form-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey);
    margin-bottom: 1rem;
    text-decoration: none;
    transition: color 0.15s;
}
.form-breadcrumb:hover { color: var(--grey-light); }
.form-breadcrumb svg   { width: 12px; height: 12px; }

.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Champs du formulaire étendu (nouvelle programmation) */
.field.is-wide input[type="text"],
.field.is-wide textarea,
.field.is-wide select {
    padding: 0.8rem 1rem;
}

.field > input[type="text"],
.field > input[type="url"],
.field > textarea,
.field > select {
    background: var(--surface);
    border: 1px solid var(--border-mid);
    color: var(--white);
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    border-radius: 2px;
}

.field > input[type="text"]:focus,
.field > input[type="url"]:focus,
.field > textarea:focus,
.field > select:focus {
    border-color: var(--border-focus);
}

.field > textarea { min-height: 100px; }
.field label .required { color: var(--draft); margin-left: 0.2rem; }

/* ══════════════════════════════════════════
   Boutons
   ══════════════════════════════════════════ */
.btn-submit {
    padding: 0.85rem;
    background: var(--white);
    color: var(--black);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: opacity 0.2s;
    font-family: inherit;
    width: 100%;
}

.btn-submit:hover { opacity: 0.85; }

/* Variante form-page (plus de padding) */
.form-actions .btn-submit {
    width: auto;
    padding: 0.8rem 1.8rem;
}

.btn-cancel {
    appearance: none;
    -webkit-appearance: none;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: inherit;
    color: var(--grey);
    text-decoration: none;
    background: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-mid);
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.btn-cancel:hover { color: var(--white); border-color: var(--border-focus); }

/* Variante texte (pas de bordure) */
.btn-cancel--text {
    border-color: transparent;
    padding-left: 0; padding-right: 0;
}

.btn-cancel--text:hover { border-color: transparent; }

.btn-primary {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--black);
    background: var(--white);
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-primary:hover { opacity: 0.85; }

.btn-new {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    background: var(--white);
    color: var(--black);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 6px;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.btn-new:hover   { opacity: 0.82; }
.btn-new svg     { width: 13px; height: 13px; }

/* Bouton icône générique */
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: none;
    border: 1px solid var(--border-mid);
    border-radius: 6px;
    color: var(--grey);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.btn-icon:hover { color: var(--white); border-color: var(--border-focus); }
.btn-icon svg   { width: 14px; height: 14px; }

.btn-danger {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background: #dc2626;
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn-danger:hover { opacity: 0.85; }

/* ══════════════════════════════════════════
   Messages flash
   ══════════════════════════════════════════ */
.flash-success {
    font-size: 0.78rem;
    color: var(--active);
    border: 1px solid var(--active-border);
    padding: 0.75rem 1rem;
    border-radius: 2px;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

.flash-error {
    font-size: 0.78rem;
    color: var(--danger);
    border: 1px solid var(--danger-border);
    padding: 0.75rem 1rem;
    border-radius: 2px;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

.flash-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.65rem 1.25rem;
    border-bottom: 1px solid var(--active-border);
    background: var(--active-bg);
    color: var(--active);
}

.flash-bar svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ══════════════════════════════════════════
   App shell (dashboard coach)
   ══════════════════════════════════════════ */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Top nav ── */
.topnav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--topnav-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    height: 56px;
    padding: 0 2rem;
}

.topnav-brand {
    display: flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--white);
    text-decoration: none;
    padding-right: 2.5rem;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
}

.topnav-tabs {
    display: flex;
    align-items: stretch;
    padding: 0 1.5rem;
    flex: 1;
}

.tab-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0 1rem;
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--grey);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.tab-link:hover        { color: var(--grey-light); }
.tab-link.active       { color: var(--white); border-bottom-color: var(--white); }
.tab-link svg          { width: 14px; height: 14px; opacity: 0.7; }
.tab-link.active svg   { opacity: 1; }

.topnav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--border);
    flex-shrink: 0;
}

.user-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--grey-light);
    letter-spacing: 0.05em;
}

.user-role {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--grey);
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    padding: 0.2rem 0.5rem;
    border-radius: 2px;
}

.btn-logout {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey);
    text-decoration: none;
    transition: color 0.15s;
}

.btn-logout:hover { color: var(--white); }

.btn-ticket {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: 1px solid var(--border-mid);
    border-radius: 50%;
    color: var(--grey);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.btn-ticket svg { width: 14px; height: 14px; }
.btn-ticket:hover { color: var(--white); border-color: var(--border-focus); }

/* ── Page content ── */
.page-content {
    flex: 1;
    padding: 2.5rem 2rem;
    max-width: 80%;
    width: 100%;
    margin: 0 auto;
}

.page-content--full { max-width: 100%; padding: 0; }

/* ══════════════════════════════════════════
   Section header
   ══════════════════════════════════════════ */
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    gap: 1rem;
}

.section-title { font-size: 1.4rem; font-weight: 900; letter-spacing: -0.02em; text-transform: uppercase; }
.section-count { font-size: 0.72rem; font-weight: 600; color: var(--grey); letter-spacing: 0.1em; margin-left: 0.75rem; }

/* ── Filtre statut programmations ── */
.status-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.35rem 0.75rem;
    border-radius: 2px;
    border: 1px solid var(--border);
    color: var(--grey);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    user-select: none;
}

.status-chip input[type="checkbox"] { display: none; }

.status-chip--active.is-active   { color: var(--active); border-color: var(--active); background: color-mix(in srgb, var(--active) 10%, transparent); }
.status-chip--draft.is-active    { color: var(--draft);  border-color: var(--draft);  background: color-mix(in srgb, var(--draft)  10%, transparent); }
.status-chip--archived.is-active { color: var(--grey);   border-color: var(--grey);   background: color-mix(in srgb, var(--grey)   10%, transparent); }

.status-chip--active.is-active   .status-dot { background: var(--active); box-shadow: var(--active-glow); }
.status-chip--draft.is-active    .status-dot { background: var(--draft); }
.status-chip--archived.is-active .status-dot { background: var(--grey); }

/* ══════════════════════════════════════════
   Grille de programmations
   ══════════════════════════════════════════ */
.prog-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.prog-card {
    background: var(--surface);
    display: flex;
    flex-direction: row;
    padding: 0;
    gap: 0;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.prog-card:hover                    { background: var(--surface-2); border-color: var(--border-mid); }
.prog-card:hover .card-arrow        { opacity: 1; transform: translateX(0); }

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── Badges de statut ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.status-dot          { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status-active       { color: var(--active); }
.status-draft        { color: var(--draft); }
.status-archived     { color: var(--grey); }
.status-active   .status-dot { background: var(--active); box-shadow: var(--active-glow); }
.status-draft    .status-dot { background: var(--draft); }
.status-archived .status-dot { background: var(--archived); }

/* ── Contenu de la carte ── */
.card-name {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.card-description {
    font-size: 0.78rem;
    color: var(--grey);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.card-meta   { display: flex; align-items: center; gap: 0.75rem; }
.meta-item   { display: flex; align-items: center; gap: 0.3rem; font-size: 0.68rem; color: var(--grey); }
.meta-item svg { width: 11px; height: 11px; opacity: 0.7; }
.meta-item--cycle { color: var(--active); font-weight: 600; }

.card-cycle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--active);
    background: var(--active-bg);
    border: 1px solid var(--active-border);
    border-radius: 2px;
    padding: 0.25rem 0.55rem;
    align-self: flex-start;
}

.card-cycle svg  { width: 9px; height: 9px; flex-shrink: 0; }

.card-arrow {
    font-size: 0.75rem;
    color: var(--grey-light);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.15s, transform 0.15s;
}

/* ── État vide ── */
.empty-state {
    grid-column: 1 / -1;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 5rem 2rem;
    text-align: center;
}

.empty-icon  { width: 40px; height: 40px; color: var(--grey); opacity: 0.4; }
.empty-title { font-size: 0.9rem; font-weight: 700; color: var(--grey-light); }
.empty-sub   { font-size: 0.75rem; color: var(--grey); }

/* ══════════════════════════════════════════
   En-tête de programmation (show)
   ══════════════════════════════════════════ */
.prog-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 2rem;
    border-bottom: 1px solid var(--border);
}

.prog-header-spacer  { flex: 1; }
.prog-header-title   { font-size: 1rem; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.prog-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.prog-status-dot                  { width: 5px; height: 5px; border-radius: 50%; }
.status-active   .prog-status-dot { background: var(--active); box-shadow: var(--active-glow); }
.status-draft    .prog-status-dot { background: var(--draft); }
.status-archived .prog-status-dot { background: var(--archived); }

/* ── Miniature image dans le header de prog ── */
.prog-header-thumb {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
}

.prog-header-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* ── Miniature dans le switcher ── */
.prog-switcher-thumb-wrap {
    width: 26px;
    height: 26px;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.prog-switcher-item-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.prog-switcher-thumb-empty {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--border-mid);
    border-radius: 3px;
}

/* ── Image dans la carte de prog ── */
.prog-card-img {
    width: 100px;
    flex-shrink: 0;
    overflow: hidden;
}

.prog-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.prog-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.9rem 1.2rem;
    min-width: 0;
}

/* ── Prévisualisation image dans la modal ── */
.prog-image-upload-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey);
    display: block;
    margin-bottom: 0.5rem;
}

.prog-image-preview {
    width: 100%;
    height: 120px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-mid);
}

.prog-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* ── Bouton retour ── */
.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-mid);
    border-radius: 2px;
    color: var(--grey);
    text-decoration: none;
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s;
}

.btn-back:hover { color: var(--white); border-color: var(--border-focus); }
.btn-back svg   { width: 14px; height: 14px; }

/* ── Bouton cycle ── */
.prog-cycle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--grey);
    text-decoration: none;
    border: 1px solid var(--border-mid);
    padding: 0.4rem 0.85rem;
    border-radius: 2px;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.prog-cycle-btn svg             { width: 13px; height: 13px; }
.prog-cycle-btn:hover           { color: var(--white); border-color: var(--border-focus); }
.prog-cycle-btn--active         { color: var(--active); border-color: var(--active-border); }
.prog-cycle-btn--active:hover   { border-color: var(--active-border-strong); }
.prog-cycle-name--empty         { opacity: 0.6; }

/* ── Switcher de programmation ── */
.prog-switcher-wrap     { position: relative; flex-shrink: 0; }

.prog-switcher-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    height: 30px;
    padding: 0 0.6rem;
    background: none;
    border: 1px solid var(--border-mid);
    border-radius: 2px;
    color: var(--grey);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.prog-switcher-btn:hover    { color: var(--white); border-color: var(--border-focus); }
.prog-switcher-btn svg      { width: 13px; height: 13px; flex-shrink: 0; }
.prog-switcher-chevron      { width: 11px !important; height: 11px !important; }

.prog-switcher-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    z-index: 100;
    padding: 0.3rem;
}

.prog-switcher-dropdown.is-open { display: block; }

.prog-switcher-header {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--grey);
    padding: 0.4rem 0.6rem 0.5rem;
}

.prog-switcher-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.6rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--grey-light);
    text-decoration: none;
    transition: background 0.1s, color 0.1s;
}

.prog-switcher-item:hover      { background: var(--hover-bg-strong); color: var(--white); }
.prog-switcher-item.is-current { color: var(--white); font-weight: 700; pointer-events: none; }
.prog-switcher-item svg        { width: 12px; height: 12px; flex-shrink: 0; margin-left: auto; color: var(--active); }

.prog-switcher-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.prog-switcher-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--grey);
}

.prog-switcher-dot.status-active   { background: var(--active); box-shadow: var(--active-glow); }
.prog-switcher-dot.status-draft    { background: var(--draft); }
.prog-switcher-dot.status-archived { background: var(--archived); }

/* ── Menu de gestion de programme ── */
.prog-menu-wrap      { position: relative; flex-shrink: 0; }

.prog-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: none;
    border: 1px solid var(--border-mid);
    border-radius: 2px;
    color: var(--grey);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.prog-menu-btn:hover { color: var(--white); border-color: var(--border-focus); }
.prog-menu-btn svg   { width: 14px; height: 14px; }

.prog-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--dropdown-bg);
    border: 1px solid var(--border-mid);
    border-radius: 4px;
    min-width: 210px;
    box-shadow: var(--dropdown-shadow);
    z-index: 300;
    padding: 0.3rem 0;
}

.prog-menu-dropdown.is-open { display: block; }

.prog-menu-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--grey-light);
    text-decoration: none;
    transition: background 0.1s, color 0.1s;
    cursor: pointer;
}

.prog-menu-item:hover             { background: var(--hover-bg-strong); color: var(--white); }
.prog-menu-item svg               { width: 13px; height: 13px; flex-shrink: 0; color: var(--grey); }
.prog-menu-item--danger           { color: var(--grey); }
.prog-menu-item--danger:hover     { color: var(--danger); background: var(--danger-bg); }
.prog-menu-item--danger svg       { color: inherit; }
.prog-menu-sep                    { height: 1px; background: var(--border); margin: 0.3rem 0; }

/* ══════════════════════════════════════════
   Navigateur de semaine
   ══════════════════════════════════════════ */
.week-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 2rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.week-nav-left  { position: absolute; left: 2rem; }
.week-nav-right { position: absolute; right: 2rem; display: flex; align-items: center; gap: 0.5rem; }
.week-nav-center{ display: flex; align-items: center; }

.week-nav-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey);
}

.btn-week {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--grey);
    text-decoration: none;
    border: 1px solid var(--border-mid);
    border-radius: 2px;
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.btn-week:hover { color: var(--white); border-color: var(--border-focus); }
.btn-week svg   { width: 14px; height: 14px; }

.btn-today {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey);
    text-decoration: none;
    border: 1px solid var(--border-mid);
    padding: 0.4rem 0.8rem;
    border-radius: 2px;
    transition: color 0.15s, border-color 0.15s;
}

.btn-today:hover          { color: var(--white); border-color: var(--border-focus); }
.btn-today.is-current     { color: var(--white); border-color: var(--border-mid); pointer-events: none; }

.btn-duplicate {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey);
    cursor: pointer;
    border: 1px solid var(--border-mid);
    background: none;
    padding: 0.4rem 0.8rem;
    border-radius: 2px;
    transition: color 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.btn-duplicate:hover { color: var(--white); border-color: var(--border-focus); }
.btn-duplicate svg   { width: 12px; height: 12px; }

/* ── Label de semaine & sélecteur de mois ── */
.week-label-wrapper { position: relative; }

.week-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.2rem;
    height: 32px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    border-top: 1px solid var(--border-mid);
    border-bottom: 1px solid var(--border-mid);
    transition: background 0.15s;
}

.week-label:hover   { background: var(--surface-2); }
.week-label svg     { width: 13px; height: 13px; color: var(--grey); flex-shrink: 0; }

.month-picker {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--dropdown-bg);
    border: 1px solid var(--border-mid);
    border-radius: 4px;
    padding: 1.2rem;
    z-index: 200;
    width: 280px;
    box-shadow: var(--dropdown-shadow);
}

.month-picker.open { display: block; }

.picker-year {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.picker-year-label { font-size: 0.82rem; font-weight: 800; letter-spacing: 0.05em; }

.btn-picker-year {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: transparent;
    border: 1px solid var(--border-mid);
    border-radius: 2px;
    color: var(--grey);
    cursor: pointer;
    transition: color 0.15s;
}

.btn-picker-year:hover { color: var(--white); }
.btn-picker-year svg   { width: 12px; height: 12px; }

.picker-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }

.picker-month {
    padding: 0.5rem 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: center;
    color: var(--grey-light);
    border-radius: 2px;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    transition: background 0.12s, color 0.12s;
    text-decoration: none;
    display: block;
}

.picker-month:hover         { background: var(--surface-2); color: var(--white); }
.picker-month.current-month { border-color: var(--border-mid); color: var(--white); }

/* ══════════════════════════════════════════
   Calendrier (grille 7 jours)
   ══════════════════════════════════════════ */
.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-height: calc(100vh - 170px);
}

.cal-day {
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.cal-day:last-child { border-right: none; }

.cal-day-header {
    padding: 0.9rem 1rem 0.7rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex-shrink: 0;
}

.cal-day.in-cycle      .cal-day-header { border-top: 2px solid var(--active-border-strong); }
.cal-day.in-cycle.is-today .cal-day-header { border-top-color: var(--active); }

.cal-cycle-tag {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--active);
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.cal-day-name   { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--grey); }
.cal-day-number { font-size: 1.4rem; font-weight: 900; letter-spacing: -0.03em; line-height: 1; color: var(--white); }

.cal-day.is-today   .cal-day-name   { color: var(--active); }
.cal-day.is-today   .cal-day-number { color: var(--active); }
.cal-day.is-weekend .cal-day-header { background: var(--weekend-bg); }
.cal-day.is-weekend .cal-day-number { color: var(--grey-light); }

.cal-day-body {
    flex: 1;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 120px;
}

.cal-day-body.sortable-over { background: var(--sortable-over-bg); }

/* ── Indicateur de chargement Turbo ── */
turbo-frame[busy] .week-nav { opacity: 0.5; pointer-events: none; transition: opacity 0.15s; }

/* ══════════════════════════════════════════
   Cartes de blocs
   ══════════════════════════════════════════ */
.block-card-wrap { position: relative; }

.block-card {
    display: block;
    position: relative;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.6rem 0.7rem;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s;
}

.block-card:hover           { border-color: var(--border-mid); }
.block-drag-ghost           { opacity: 0.35; }

.block-drag-handle {
    cursor: grab;
    user-select: none;
}
.block-drag-handle:active { cursor: grabbing; }

.block-card-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--white);
    margin-bottom: 0.3rem;
}

.block-card-content { font-size: 0.85rem; line-height: 1.2; color: var(--grey-light); white-space: pre-wrap; }

.block-card-garmin { display: flex; flex-direction: column; gap: 2px; white-space: normal; }
.gcr {
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 2px;
    width: fit-content;
}
.gcr--nested        { margin-left: 10px; font-weight: 500; opacity: 0.9; }
.gcr--repeat        { color: #fbbf24; background: rgba(251,191,36,0.1); }
.gcr--warmup,
.gcr--cooldown      { color: #4ade80; background: rgba(74,222,128,0.08); }
.gcr--active        { color: #f87171; background: rgba(248,113,113,0.08); }
.gcr--recovery      { color: #60a5fa; background: rgba(96,165,250,0.08); }

.block-card-score {
    margin-top: 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--active);
}

/* ── Badges sur les blocs ── */
.block-card-badges { display: flex; align-items: center; gap: 0.3rem; margin-top: 0.35rem; }

.block-card-badge       { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.7rem; font-weight: 700; }
.block-card-badge svg   { width: 11px; height: 11px; }
.block-card-badge--tips { color: var(--draft); opacity: 0.8; }
.block-card-badge--media{ color: var(--active); }

/* ── Thumbnail ── */
.block-card-thumb-wrap  { position: relative; margin-top: 0.45rem; border-radius: 2px; overflow: hidden; line-height: 0; }
.block-card-thumb       { width: 100%; height: 72px; object-fit: cover; display: block; }
.block-card-thumb-more  { position: absolute; bottom: 0.3rem; right: 0.3rem; background: rgba(0,0,0,0.7); color: #fff; font-size: 0.6rem; font-weight: 800; padding: 0.1rem 0.35rem; border-radius: 2px; }

/* ── Boutons d'action sur bloc (supprimés du rendu planning, gardés pour référence) ── */
.block-delete-form { display: none; }
.btn-block-delete  { display: none; }

/* ── Badge scores sur la carte bloc ── */
.btn-block-scores {
    position: absolute;
    bottom: 0.45rem;
    right: 0.45rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.2rem 0.45rem;
    background: rgba(99,179,237,0.12);
    border: 1px solid rgba(99,179,237,0.25);
    border-radius: 3px;
    color: #63b3ed;
    text-decoration: none;
    z-index: 3;
    transition: background 0.15s, border-color 0.15s;
}
.btn-block-scores:hover { background: rgba(99,179,237,0.22); border-color: rgba(99,179,237,0.45); }
.btn-block-scores svg   { width: 10px; height: 10px; flex-shrink: 0; }

/* ── Boutons d'action sur bloc ── */
.block-delete-form {
    position: absolute;
    top: 0.45rem;
    left: 0.45rem;
    margin: 0;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 2;
}

.block-card-wrap:hover .block-delete-form { opacity: 1; }

.btn-block-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--grey);
    padding: 0;
    border-radius: 2px;
    transition: color 0.15s;
}

.btn-block-delete:hover { color: var(--danger); }
.btn-block-delete svg   { width: 11px; height: 11px; }

.btn-block-delete-modal {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--grey);
    background: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-mid);
    border-radius: 2px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.btn-block-delete-modal:hover { color: var(--danger); border-color: var(--danger-border); }

/* ── Bouton ajouter un bloc ── */
.btn-add-block {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 30px;
    margin-top: 0.2rem;
    border: 1px dashed var(--border-mid);
    border-radius: 3px;
    color: var(--grey);
    text-decoration: none;
    font-size: 1rem;
    line-height: 1;
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.btn-add-block:hover { color: var(--white); border-color: var(--border-focus); }

/* ══════════════════════════════════════════
   Swatches de couleur (formulaire bloc)
   ══════════════════════════════════════════ */
.color-swatches             { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.color-swatch-label         { cursor: pointer; position: relative; }
.color-swatch-label input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.color-swatch               { display: block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; transition: transform 0.1s, border-color 0.1s; }
.color-swatch-label:hover .color-swatch { transform: scale(1.15); }
.color-swatch-label input[type="radio"]:checked + .color-swatch { border-color: var(--white); transform: scale(1.15); }
.color-swatch-none          { background: transparent; border-color: var(--border-mid) !important; position: relative; }
.color-swatch-none::after   { content: '×'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; color: var(--grey); }

/* ══════════════════════════════════════════
   Section tips (formulaire bloc)
   ══════════════════════════════════════════ */
.tips-chevron { width: 13px; height: 13px; margin-left: auto; transition: transform 0.2s; }

/* ══════════════════════════════════════════
   Modaux
   ══════════════════════════════════════════ */
html:has(.modal-backdrop),
body:has(.modal-backdrop) { overflow: hidden; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: var(--modal-backdrop);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal {
    position: relative;
    background: var(--surface-elevated);
    border: 1px solid var(--border-mid);
    border-radius: 12px;
    width: clamp(480px, 55vw, 860px);
    max-width: 100%;
    box-shadow: var(--modal-shadow);
    display: flex;
    flex-direction: column;
    margin: 0 auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 0.82rem; font-weight: 800; letter-spacing: 0.02em; }

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--grey);
    text-decoration: none;
    flex-shrink: 0;
    border: 1px solid transparent;
    border-radius: 2px;
    transition: color 0.15s;
    background: none;
    cursor: pointer;
}

.modal-close:hover { color: var(--white); }
.modal-close svg   { width: 14px; height: 14px; }

.modal-body   { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }

.modal .form-group label { font-size: 0.75rem; }
.modal .form-group input[type="text"],
.modal .form-group input[type="date"],
.modal .form-group input[type="email"],
.modal .form-group input[type="password"],
.modal .form-group textarea,
.modal .form-group select { font-size: 0.9rem; }

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

/* ── Modal guard — confirmation dialog ── */
.mgc-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}
.mgc-dialog {
    background: var(--surface-elevated);
    border: 1px solid var(--border-mid);
    border-radius: 6px;
    padding: 1.5rem;
    width: min(360px, 90%);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    box-shadow: var(--modal-shadow);
}
.mgc-title {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: 0.01em;
}
.mgc-text {
    margin: 0;
    font-size: 0.75rem;
    color: var(--grey);
    line-height: 1.5;
}
.mgc-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

/* ── Section médias dans le modal d'édition ── */
.modal-section {
    border-top: 1px solid var(--border);
    padding: 0.9rem 1.25rem 1.1rem;
}

/* ══════════════════════════════════════════
   Sélecteur de médias
   ══════════════════════════════════════════ */
.media-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey);
    padding: 0;
    width: 100%;
    transition: color 0.15s;
}

.media-toggle:hover              { color: var(--white); }
.media-toggle svg:first-child    { width: 14px; height: 14px; }
.media-toggle .tips-chevron      { margin-left: auto; }

.media-badge {
    background: var(--active);
    color: var(--black);
    border-radius: 10px;
    padding: 0 0.45rem;
    font-size: 0.58rem;
    font-weight: 900;
    line-height: 1.6;
}

.media-panel               { display: none; flex-direction: column; gap: 0.65rem; margin-top: 0.75rem; }
.media-panel.open          { display: flex; }
.media-list                { display: flex; flex-direction: column; gap: 0.4rem; }

.media-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.35rem 0.5rem;
}

.media-thumb             { width: 56px; height: 42px; object-fit: cover; border-radius: 2px; flex-shrink: 0; }
.media-thumb-placeholder { width: 56px; height: 42px; background: var(--surface-2); border-radius: 2px; flex-shrink: 0; }

.media-info  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.media-name  { font-size: 0.75rem; font-weight: 600; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-url   { font-size: 0.62rem; color: var(--grey); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.media-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--grey);
    padding: 0.3rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.media-remove:hover { color: var(--danger); }
.media-remove svg   { width: 13px; height: 13px; }

.media-search-wrap  { position: relative; }

.media-search-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface);
    border: 1px solid var(--border-mid);
    border-radius: 8px;
    color: var(--white);
    font-size: 0.78rem;
    padding: 0.5rem 0.7rem;
    font-family: inherit;
    transition: border-color 0.15s;
}

.media-search-input:focus { outline: none; border-color: var(--border-focus); }

.media-suggestions {
    margin-top: 0.3rem;
    background: var(--suggestions-bg);
    border: 1px solid var(--border-mid);
    border-radius: 8px;
    max-height: 180px;
    overflow-y: auto;
}

.media-suggestions:empty { display: none; }

.media-suggestion {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.1s;
}

.media-suggestion:hover { background: var(--surface); }
.media-thumb-sm         { width: 36px; height: 27px; object-fit: cover; border-radius: 2px; flex-shrink: 0; }
.media-empty            { font-size: 0.72rem; color: var(--grey); padding: 0.6rem; text-align: center; }

.media-add {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    padding-top: 0.25rem;
    border-top: 1px dashed var(--border);
}

.media-add-input {
    background: var(--surface);
    border: 1px solid var(--border-mid);
    border-radius: 8px;
    color: var(--white);
    font-size: 0.75rem;
    padding: 0.45rem 0.65rem;
    font-family: inherit;
    transition: border-color 0.15s;
}

.media-add-input:focus  { outline: none; border-color: var(--border-focus); }
.media-add-input:first-child { width: 30%; flex-shrink: 0; }
.media-add-url          { flex: 1; min-width: 0; }

.btn-media-add {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--black);
    background: var(--white);
    padding: 0.45rem 0.85rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.btn-media-add:hover { opacity: 0.85; }

/* ══════════════════════════════════════════
   Cycles — modal
   ══════════════════════════════════════════ */
.modal--cycles { width: 520px; }

.cycle-modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.cycle-modal-title {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cycle-modal-title svg { width: 14px; height: 14px; color: var(--grey); }

.btn-cycle-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    color: var(--grey);
    text-decoration: none;
    border: 1px solid var(--border-mid);
    border-radius: 2px;
    transition: color 0.15s;
    background: none;
    cursor: pointer;
}

.btn-cycle-back:hover { color: var(--white); }
.btn-cycle-back svg   { width: 13px; height: 13px; }

.cycle-list     { padding: 0.5rem 0; max-height: 55vh; overflow-y: auto; }
.cycle-empty    { font-size: 0.78rem; color: var(--grey); line-height: 1.5; padding: 1.25rem; text-align: center; }

.cycle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

.cycle-row:hover        { background: var(--hover-bg); }
.cycle-row--active      { background: var(--cycle-active-bg); }
.cycle-row-left         { display: flex; align-items: flex-start; gap: 0.6rem; flex: 1; min-width: 0; }

.cycle-active-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--active);
    box-shadow: var(--active-glow);
    flex-shrink: 0;
    margin-top: 0.35rem;
}

.cycle-row-info   { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.cycle-row-name   { font-size: 0.82rem; font-weight: 700; color: var(--white); }
.cycle-row-dates  { font-size: 0.65rem; color: var(--grey); letter-spacing: 0.03em; }
.cycle-row-desc   { font-size: 0.7rem; color: var(--grey-light); margin-top: 0.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cycle-row-actions { display: flex; align-items: center; gap: 0.3rem; flex-shrink: 0; }

.btn-cycle-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: 1px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    color: var(--grey);
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
}

.btn-cycle-action svg       { width: 13px; height: 13px; }
.btn-cycle-action:hover     { color: var(--white); border-color: var(--border-mid); }
.btn-cycle-delete:hover     { color: var(--danger); border-color: var(--danger-border); }

.cycle-modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.btn-cycle-new { font-size: 0.72rem; text-decoration: none; }

/* ── Formulaire de cycle ── */
.cycle-form-error {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: 3px;
    padding: 0.7rem 0.85rem;
    font-size: 0.78rem;
    color: var(--danger);
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.cycle-form-error svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 0.1rem; }

.cycle-occupied {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.6rem 0.75rem;
    background: var(--occupied-bg);
    border: 1px solid var(--border);
    border-radius: 3px;
}

.cycle-occupied-label { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey); }
.cycle-occupied-list  { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.cycle-occupied-pill  { font-size: 0.65rem; font-weight: 600; color: var(--grey-light); background: var(--surface); border: 1px solid var(--border-mid); border-radius: 2px; padding: 0.2rem 0.5rem; white-space: nowrap; }

.cycle-dates-row      { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.cycle-overlap-warning {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    background: var(--draft-bg);
    border: 1px solid var(--draft-border);
    border-radius: 3px;
    padding: 0.55rem 0.75rem;
    font-size: 0.73rem;
    color: var(--draft);
    line-height: 1.4;
}

.cycle-overlap-warning[hidden] { display: none; }
.cycle-overlap-warning svg     { width: 13px; height: 13px; flex-shrink: 0; margin-top: 0.1rem; }

/* ══════════════════════════════════════════
   Modal de duplication de semaine
   ══════════════════════════════════════════ */
.dup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: var(--modal-backdrop);
    display: none;
    align-items: center;
    justify-content: center;
}

.dup-backdrop.is-open { display: flex; }

.dup-modal {
    background: var(--surface-elevated);
    border: 1px solid var(--border-mid);
    border-radius: 6px;
    width: 420px;
    max-width: 95vw;
    box-shadow: var(--modal-shadow);
}

.dup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.dup-title { font-size: 0.82rem; font-weight: 800; letter-spacing: 0.02em; }

.dup-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--grey);
    background: none;
    border: 1px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    transition: color 0.15s;
}

.dup-close:hover { color: var(--white); }
.dup-close svg   { width: 14px; height: 14px; }

.dup-body     { padding: 1.4rem 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.dup-info     { font-size: 0.8rem; color: var(--grey-light); line-height: 1.6; }
.dup-weeks    { display: flex; flex-direction: column; gap: 0.5rem; }

.dup-week-row { display: flex; align-items: center; gap: 0.6rem; font-size: 0.78rem; }

.dup-week-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey);
    width: 60px;
    flex-shrink: 0;
}

.dup-week-dates { color: var(--white); font-weight: 600; }
.dup-arrow      { color: var(--active); font-size: 1rem; padding-left: 66px; }

.dup-count {
    font-size: 0.72rem;
    color: var(--grey);
    padding: 0.6rem 0.8rem;
    background: var(--surface-2);
    border-radius: 3px;
    border-left: 2px solid var(--active);
}

.dup-count strong { color: var(--white); }

.dup-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--draft);
    background: var(--draft-bg);
    border: 1px solid var(--draft-border);
    border-radius: 3px;
    padding: 0.65rem 0.8rem;
    line-height: 1.5;
}

.dup-warning svg    { width: 13px; height: 13px; flex-shrink: 0; margin-top: 0.1rem; }
.dup-warning strong { color: var(--white); }

.dup-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════════
   Modal coachs
   ══════════════════════════════════════════ */
.coaches-section-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--grey);
    margin-bottom: 0.5rem;
}

.coach-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
}

.coach-row:last-child { border-bottom: none; }

.coach-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--white);
    flex-shrink: 0;
}

.coach-info  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.05rem; }
.coach-name  { font-size: 0.8rem; font-weight: 700; color: var(--white); }
.coach-email { font-size: 0.65rem; color: var(--grey); }
.coach-empty { font-size: 0.78rem; color: var(--grey); margin: 0; }

.coach-badge {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--active);
    background: var(--active-bg);
    border: 1px solid var(--active-border);
    border-radius: 2px;
    padding: 0.15rem 0.5rem;
    flex-shrink: 0;
}

.btn-coach-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    background: none;
    border: 1px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    color: var(--grey);
    transition: color 0.15s, border-color 0.15s;
}

.btn-coach-remove:hover { color: var(--danger); border-color: var(--danger-border); }
.btn-coach-remove svg   { width: 12px; height: 12px; }

.btn-coach-add {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--active);
    background: var(--active-bg);
    border: 1px solid var(--active-border);
    border-radius: 2px;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.btn-coach-add:hover { background: var(--active-bg); border-color: var(--active-border-strong); }
.btn-coach-add svg   { width: 11px; height: 11px; }


/* ══════════════════════════════════════════
   Athlètes — Liste
   ══════════════════════════════════════════ */
.athletes-filter-form {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.athletes-filter-select {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.45rem 0.85rem;
    height: auto;
    min-width: 200px;
}

.athletes-filter-clear {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--grey);
    text-decoration: none;
    transition: color 0.15s;
    white-space: nowrap;
}

.athletes-filter-clear:hover { color: var(--white); }

.athletes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.athlete-card {
    background: var(--surface);
    padding: 1.4rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.athlete-card:hover                 { background: var(--surface-2); }
.athlete-card:hover .card-arrow     { opacity: 1; transform: translateX(0); }

.athlete-card-top {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.athlete-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--grey-light);
    flex-shrink: 0;
}

.athlete-card-info  { flex: 1; min-width: 0; }

.athlete-card-name {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.athlete-card-email {
    font-size: 0.7rem;
    color: var(--grey);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.15rem;
}

.athlete-card-programs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-height: 22px;
}

.program-tag {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--grey-light);
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    border-radius: 2px;
    padding: 0.2rem 0.5rem;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.program-tag--more {
    color: var(--grey);
    background: none;
}

.athlete-no-program {
    font-size: 0.68rem;
    color: var(--grey);
    font-style: italic;
}

.athlete-card-footer {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════════
   Athlètes — Profil (show)
   ══════════════════════════════════════════ */
.athlete-page {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.athlete-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.athlete-header-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--grey-light);
    flex-shrink: 0;
    align-self: center;
}

.athlete-header-info { flex: 1; min-width: 0; }

.athlete-header-name {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.athlete-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.athlete-header-programs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    align-self: center;
}

.athlete-stats {
    display: flex;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.athlete-stat {
    flex: 1;
    background: var(--surface);
    padding: 1.2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.athlete-stat-value {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1;
}

.athlete-stat-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--grey);
}

.athlete-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 5rem 2rem;
    text-align: center;
    color: var(--grey);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.athlete-empty svg { width: 36px; height: 36px; opacity: 0.3; }
.athlete-empty p   { font-size: 0.82rem; }

/* ── Sections de performance ── */
.perf-section { display: flex; flex-direction: column; gap: 1rem; }

.perf-section-summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.6rem 0;
    user-select: none;
}

.perf-section-summary::-webkit-details-marker { display: none; }

.perf-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--grey);
}

.perf-section-chevron {
    margin-left: auto;
    color: var(--grey);
    transition: transform 0.2s;
}

.perf-section-chevron svg { width: 14px; height: 14px; display: block; }
.perf-section[open] .perf-section-chevron { transform: rotate(180deg); }
.perf-section:not([open]) .perf-metrics-grid { display: none; }

.perf-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

/* ── Carte métrique (details/summary) ── */
.perf-card {
    background: var(--surface);
}

.perf-card[open] { background: var(--surface-2); }

.perf-card-summary {
    list-style: none;
    padding: 1.3rem 1.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    position: relative;
    transition: background 0.15s;
}

.perf-card-summary::-webkit-details-marker { display: none; }
.perf-card-summary:hover { background: var(--hover-bg-strong); }

.perf-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-right: 1.5rem;
}

.perf-card-name {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.perf-card-type {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 0.15rem 0.45rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.perf-card[open] .perf-card-type { background: var(--surface); }

.perf-card-body { display: flex; flex-direction: column; gap: 0.6rem; }

.perf-pr { display: flex; flex-direction: column; gap: 0.2rem; }

.perf-pr-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--grey);
}

.perf-pr-value {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1;
}

.perf-pr-value small {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--grey-light);
}

.perf-pr-date {
    font-size: 0.65rem;
    color: var(--grey);
    letter-spacing: 0.04em;
}

.perf-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.perf-count {
    font-size: 0.64rem;
    color: var(--grey);
}

.perf-card-chevron {
    position: absolute;
    top: 1.3rem;
    right: 1.2rem;
    color: var(--grey);
    transition: transform 0.2s;
}

.perf-card-chevron svg { width: 14px; height: 14px; }
.perf-card[open] .perf-card-chevron { transform: rotate(180deg); }

/* ── Historique ── */
.perf-history {
    border-top: 1px solid var(--border);
    overflow-x: auto;
}

.perf-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.perf-history-table th {
    padding: 0.6rem 1.5rem;
    text-align: left;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--grey);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.perf-history-table td {
    padding: 0.65rem 1.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--grey-light);
    vertical-align: top;
}

.perf-history-table tr:last-child td { border-bottom: none; }
.perf-history-table tr:hover td { background: var(--hover-bg); }

.perf-row--pr td { color: var(--white); }

.perf-row-date  { white-space: nowrap; color: var(--grey); font-size: 0.7rem; }
.perf-row-value { font-weight: 700; color: var(--white); }
.perf-row-rm    { white-space: nowrap; color: var(--grey); }
.perf-row-notes { color: var(--grey); max-width: 200px; }

.pr-badge {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--active);
    background: var(--active-bg);
    border: 1px solid var(--active-border);
    border-radius: 2px;
    padding: 0.1rem 0.4rem;
    margin-left: 0.4rem;
    vertical-align: middle;
}

/* ══════════════════════════════════════════
   Taux de complétion — widget semaine
   ══════════════════════════════════════════ */
.completion-chip {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--grey-light);
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    border-radius: 2px;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
}

.completion-chip svg         { width: 11px; height: 11px; flex-shrink: 0; }
.completion-chip--full       { color: var(--active); border-color: var(--active-border); background: var(--active-bg); }
.completion-chip-value       { font-weight: 800; }

/* ══════════════════════════════════════════
   Sélecteur de template (formulaire bloc)
   ══════════════════════════════════════════ */
.tpl-select-group select {
    border-style: dashed;
    color: var(--grey);
}

/* La form dans le footer ne doit pas ajouter de hauteur */
.modal-footer-form { margin: 0; display: flex; align-items: center; }

#template-save-msg:empty { display: none; }

/* ── Modal header avec sous-titre ── */
.modal-header-info { display: flex; flex-direction: column; gap: 0.15rem; }
.modal-subtitle { font-size: 0.7rem; color: var(--grey); font-weight: 500; }

/* ── Liste des scores ── */
.scores-empty {
    font-size: 0.82rem;
    color: var(--grey);
    text-align: center;
    padding: 1.5rem 0;
    margin: 0;
}

.scores-list { display: flex; flex-direction: column; gap: 0; }

.score-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
.score-row:last-child { border-bottom: none; }

.score-athlete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.score-athlete-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--white);
}
.score-recorded-at {
    font-size: 0.7rem;
    color: var(--grey);
}

.score-value-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.score-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.01em;
}
.score-rxd {
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: var(--active);
    background: var(--active-bg);
    border: 1px solid var(--active-border);
    border-radius: 3px;
    padding: 0.1rem 0.35rem;
}
.score-scaled {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--draft);
    background: var(--draft-bg);
    border: 1px solid var(--draft-border);
    border-radius: 3px;
    padding: 0.1rem 0.35rem;
}
.score-notes {
    font-size: 0.75rem;
    color: var(--grey-light);
    line-height: 1.4;
    white-space: pre-wrap;
}

.template-saved-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    color: var(--active);
    padding: 0.65rem 1.25rem;
    border-top: 1px solid var(--active-border);
    background: var(--active-bg);
    border-radius: 0 0 6px 6px;
}

.template-saved-notice svg { width: 13px; height: 13px; flex-shrink: 0; }
.template-saved-notice a   { color: var(--active); text-decoration: underline; }

/* ══════════════════════════════════════════
   Bibliothèque de blocs
   ══════════════════════════════════════════ */
.library-card-score {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 0.15rem 0.45rem;
    white-space: nowrap;
}

.btn-library-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--grey);
    padding: 0.2rem;
    display: flex;
    align-items: center;
    transition: color 0.15s;
    border-radius: 2px;
}

.btn-library-delete:hover { color: var(--danger); }
.btn-library-delete svg   { width: 13px; height: 13px; }

/* ══════════════════════════════════════════
   Garmin — Block type badge + export button
   ══════════════════════════════════════════ */
.block-card-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
}

.block-type-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    flex-shrink: 0;
}

.block-type-badge--run      { background: rgba(74,222,128,0.10); color: #4ade80; border: 1px solid rgba(74,222,128,0.22); }
.block-type-badge--strength { background: rgba(96,165,250,0.10); color: #60a5fa; border: 1px solid rgba(96,165,250,0.22); }
.block-type-badge--cardio   { background: rgba(248,113,113,0.10); color: #f87171; border: 1px solid rgba(248,113,113,0.22); }
.block-type-badge--wod      { background: rgba(251,191,36,0.10);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.22); }
.block-type-badge--skill    { background: rgba(192,132,252,0.10); color: #c084fc; border: 1px solid rgba(192,132,252,0.22); }
.block-type-badge--rest     { background: rgba(45,212,191,0.10);  color: #2dd4bf; border: 1px solid rgba(45,212,191,0.22); }

.btn-garmin-export {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.62rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    background: rgba(74,222,128,0.10);
    border: 1px solid rgba(74,222,128,0.25);
    border-radius: 3px;
    color: #4ade80;
    text-decoration: none;
    cursor: pointer;
    z-index: 3;
    opacity: 0;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.block-card-wrap:hover .btn-garmin-export { opacity: 1; }

.btn-garmin-export:hover {
    background: rgba(74,222,128,0.20);
    border-color: rgba(74,222,128,0.45);
}

.btn-garmin-export svg { flex-shrink: 0; }

/* ── Metric autocomplete ───────────────────────────────────── */

.autocomplete-wrap { position: relative; }

.metric-suggestions {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 200;
    background: #1a2035;
    border: 1px solid #2e3a5a;
    border-radius: 8px;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 6px 20px rgba(0,0,0,.45);
}

.metric-suggestion {
    display: flex;
    align-items: baseline;
    gap: 10px;
    width: 100%;
    padding: 7px 12px;
    background: none;
    border: none;
    border-bottom: 1px solid #22304a;
    cursor: pointer;
    text-align: left;
    color: #e2e8f0;
    font-size: .875rem;
    transition: background .1s;
}
.metric-suggestion:last-child { border-bottom: none; }
.metric-suggestion:hover,
.metric-suggestion.is-active  { background: #243058; outline: none; }

.metric-suggestion-slug {
    font-family: ui-monospace, monospace;
    font-size: .82rem;
    font-weight: 600;
    color: #60a5fa;
    flex-shrink: 0;
}
.metric-suggestion-slug mark {
    background: none;
    color: #fbbf24;
}
.metric-suggestion-name {
    color: #94a3b8;
    font-size: .8rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.metric-suggestion-unit {
    color: #64748b;
    font-size: .75rem;
    font-style: italic;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════
   Garmin — Workout step builder
   ══════════════════════════════════════════ */
.garmin-section {
    margin-top: 0.75rem;
    padding: 0.9rem;
    border: 1px solid var(--border-mid);
    border-radius: 6px;
    background: var(--surface-2);
}

.garmin-section-title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #4ade80;
    margin-bottom: 0.75rem;
}

.garmin-section-title svg { flex-shrink: 0; stroke: #4ade80; }

.garmin-name-label { font-size: 0.75rem; color: var(--grey-light); }

.garmin-name-input {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    padding: 0.4rem 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border-mid);
    border-radius: 4px;
    color: var(--white);
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
}

.garmin-name-input:focus {
    outline: none;
    border-color: rgba(74,222,128,0.35);
}

/* Step list */
.garmin-steps {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

/* Base step */
.garmin-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface-elevated);
    flex-wrap: wrap;
    border-left-width: 3px;
}

.garmin-step--warmup   { border-left-color: #4ade80; }
.garmin-step--active   { border-left-color: #f87171; }
.garmin-step--recovery { border-left-color: #60a5fa; }
.garmin-step--cooldown { border-left-color: #2dd4bf; }

/* Repeat group overrides */
.garmin-step--repeat {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    border-left-color: #fbbf24;
}

.garmin-step-type {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--white);
    min-width: 90px;
}

.garmin-field {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: var(--grey-light);
}

.garmin-field input[type="number"] {
    width: 56px;
    padding: 0.2rem 0.35rem;
    background: var(--surface);
    border: 1px solid var(--border-mid);
    border-radius: 3px;
    color: var(--white);
    font-size: 0.7rem;
    text-align: center;
}

.garmin-field--count input[type="number"] { width: 44px; }

.garmin-step-del {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--grey);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0.15rem 0.3rem;
    border-radius: 3px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}

.garmin-step-del:hover { color: var(--danger); background: var(--danger-bg); }
.garmin-step-del--right { margin-left: auto; }

/* Repeat group internals */
.garmin-repeat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    flex-wrap: wrap;
}

.garmin-repeat-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0 0.6rem 0.4rem;
}

.garmin-repeat-body .garmin-step {
    border-radius: 3px;
}

.garmin-repeat-footer {
    display: flex;
    gap: 0.35rem;
    padding: 0.4rem 0.6rem;
    border-top: 1px solid var(--border);
}

/* Add-step buttons */
.garmin-add-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.btn-garmin-add {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.28rem 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border-mid);
    border-radius: 6px;
    color: var(--grey-light);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.btn-garmin-add:hover {
    color: var(--white);
    border-color: var(--border-focus);
    background: var(--hover-bg-strong);
}

/* ══════════════════════════════════════════
   Page Profil
   ══════════════════════════════════════════ */
.profile-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

@media (max-width: 800px) {
    .profile-layout { grid-template-columns: 1fr; }
}

.profile-card {
    background: var(--surface);
    display: flex;
    flex-direction: column;
}

.profile-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--grey);
    padding: 1.4rem 1.8rem 0;
}

.profile-card-header svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.profile-form {
    display: contents;
}

.profile-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.2rem 1.8rem;
    flex: 1;
}

.profile-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.profile-footer {
    padding: 1rem 1.8rem 1.6rem;
    display: flex;
    justify-content: flex-end;
}

.profile-hint {
    font-size: 0.68rem;
    color: var(--grey);
    line-height: 1.6;
    margin: 0;
}

/* Password inputs don't need auto-resize */
.profile-form input[type="password"] {
    -webkit-text-security: disc;
}

/* ══════════════════════════════════════════
   Page Administration
   ══════════════════════════════════════════ */

/* ── Onglet Admin ── */
.tab-link--admin { color: var(--draft); }
.tab-link--admin.active { color: var(--draft); border-bottom-color: var(--draft); }

/* ── Panel invitation ── */
.invite-panel {
    display: none;
    margin-bottom: 2rem;
}
.invite-panel.is-open { display: block; }

.invite-panel-inner {
    background: var(--surface);
    border: 1px solid var(--border-mid);
    border-radius: 4px;
    padding: 1.4rem 1.8rem;
}

.invite-panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--grey);
    margin-bottom: 1.2rem;
}

.invite-form { display: flex; flex-direction: column; gap: 1rem; }

.invite-roles {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.invite-role-option {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s;
    flex: 1;
    min-width: 180px;
}

.invite-role-option:has(input:checked) {
    border-color: var(--border-focus);
}

.invite-role-option input[type="radio"] { margin-top: 0.15rem; flex-shrink: 0; }

.invite-role-label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.invite-role-label strong { font-size: 0.8rem; font-weight: 700; color: var(--white); }
.invite-role-label span   { font-size: 0.7rem; color: var(--grey); }

/* ── Lien généré ── */
.invite-success { display: flex; flex-direction: column; gap: 0.75rem; }

.invite-success-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--active);
}

.invite-link-row { display: flex; gap: 0.5rem; align-items: center; }

.invite-link-input {
    flex: 1;
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    border-radius: 3px;
    color: var(--grey-light);
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-family: monospace;
    min-width: 0;
}

.btn-copy, .btn-copy-small {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    border-radius: 3px;
    color: var(--grey-light);
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.btn-copy:hover, .btn-copy-small:hover {
    color: var(--white);
    border-color: var(--border-focus);
}

.btn-copy-small { padding: 0.3rem 0.65rem; font-size: 0.62rem; }

/* ── Table invitations ── */
.invitations-table-wrap { overflow-x: auto; }

.invitations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.invitations-table th {
    text-align: left;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--grey);
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.invitations-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--grey-light);
    vertical-align: middle;
}

.invitations-table tr.inv-used td,
.invitations-table tr.inv-expired td { opacity: 0.45; }

.inv-role {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 2px;
}

.inv-role--creator { color: var(--draft); background: color-mix(in srgb, var(--draft) 12%, transparent); }
.inv-role--coach   { color: var(--grey-light); background: var(--surface-2); }

.inv-status {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.inv-status--valid   { color: var(--active); }
.inv-status--used    { color: var(--grey); }
.inv-status--expired { color: var(--danger); }

/* ── Admin sub-nav ── */
.admin-subnav {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.admin-subnav-link {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--grey);
    text-decoration: none;
    padding: 0.5rem 0.9rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

.admin-subnav-link:hover { color: var(--grey-light); }
.admin-subnav-link.active { color: var(--draft); border-bottom-color: var(--draft); }

/* ── Metric filter bar ── */
.metric-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.metric-filter-search {
    position: relative;
    flex: 1;
    min-width: 0;
}

.metric-filter-search svg {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    width: 13px;
    height: 13px;
    color: var(--grey);
    pointer-events: none;
}

.metric-filter-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface);
    border: 1px solid var(--border-mid);
    border-radius: 6px;
    color: var(--white);
    font-size: 0.78rem;
    padding: 0.45rem 0.75rem 0.45rem 2rem;
    font-family: inherit;
    transition: border-color 0.15s;
}

.metric-filter-input::placeholder { color: var(--grey); }
.metric-filter-input:focus { outline: none; border-color: var(--border-focus); }

.metric-filter-select {
    background: var(--surface);
    border: 1px solid var(--border-mid);
    border-radius: 6px;
    color: var(--grey-light);
    font-size: 0.75rem;
    padding: 0.45rem 0.75rem;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    transition: border-color 0.15s;
    flex-shrink: 0;
    width: 160px;
}

.metric-filter-select:focus { outline: none; border-color: var(--border-focus); }

.metric-filter-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--border-mid);
    border-radius: 6px;
    color: var(--grey);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    padding: 0;
}

.metric-filter-reset svg { width: 12px; height: 12px; }
.metric-filter-reset:hover { color: var(--grey-light); border-color: var(--border-focus); }

.metric-filter-empty {
    font-size: 0.78rem;
    color: var(--grey);
    padding: 1.5rem 0;
    text-align: center;
}

/* ── Metric types table ── */
.metric-types-table .metric-name-cell { font-weight: 600; color: var(--white); }

.metric-slug {
    font-size: 0.7rem;
    font-family: monospace;
    color: var(--grey-light);
    background: var(--surface-2);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.metric-recording { font-size: 0.75rem; color: var(--grey-light); }
.metric-unit      { font-size: 0.75rem; color: var(--grey); }

.metric-category {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 2px;
    background: var(--surface-2);
    color: var(--grey-light);
}

.metric-status {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.metric-status--active   { color: var(--active); }
.metric-status--archived { color: var(--grey); }

.metric-archived-row td { opacity: 0.45; }

.metric-actions { display: flex; gap: 0.4rem; align-items: center; white-space: nowrap; }

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-decoration: none;
    background: none;
    border: 1px solid var(--border-mid);
    border-radius: 4px;
    color: var(--grey-light);
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.btn-action svg { width: 11px; height: 11px; flex-shrink: 0; }
.btn-action:hover { color: var(--white); border-color: var(--border-focus); }

.btn-action--archive:hover { color: var(--danger); border-color: var(--danger-border, #f0606080); }
.btn-action--restore       { color: var(--active); border-color: color-mix(in srgb, var(--active) 35%, transparent); }
.btn-action--restore:hover { color: var(--active); border-color: var(--active); }

/* ── Form 2-col grid ── */
.form-two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 500px) {
    .form-two-cols { grid-template-columns: 1fr; }
}

/* ── btn-cancel ── */
.btn-cancel {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--grey);
    text-decoration: none;
    transition: color 0.15s;
}

.btn-cancel:hover { color: var(--grey-light); }

/* ── Toggle mot de passe ── */
.pw-wrap {
    position: relative;
}

.pw-wrap input {
    padding-right: 2.75rem !important;
}

.pw-toggle {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.2rem;
    cursor: pointer;
    color: var(--grey);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.pw-toggle:hover { color: var(--white); }
.pw-toggle svg   { width: 16px; height: 16px; display: block; }

/* ── Block preview — modal élargie avec aperçu téléphone ── */

.modal--with-preview {
    width: clamp(680px, 80vw, 1160px);
}

.block-form-split {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.block-form-split-left {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.block-form-split-right {
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preview-panel-title {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--grey);
    margin: 0;
}

/* Maquette téléphone */
.phone-mockup {
    background: var(--surface);
    border: 1.5px solid var(--border-mid);
    border-radius: 18px;
    padding: 0.75rem 0.875rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-height: 180px;
}

.phone-notch {
    width: 36px;
    height: 4px;
    background: var(--border-strong);
    border-radius: 2px;
    margin: 0 auto;
    flex-shrink: 0;
}

.phone-screen {
    font-size: 0.78rem;
    line-height: 1.65;
    color: var(--white);
    word-break: break-word;
    flex: 1;
}

.preview-empty {
    color: var(--grey);
    font-style: italic;
}

.preview-slug {
    background: color-mix(in srgb, var(--draft) 14%, transparent);
    color: var(--draft);
    border-radius: 3px;
    padding: 0 3px;
    font-size: 0.85em;
    font-family: monospace;
}

.preview-resolved {
    font-weight: 700;
    color: var(--active);
    background: var(--active-bg);
    border-radius: 3px;
    padding: 0 3px;
}

/* Inputs RM */
.rm-inputs-section {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    border-top: 1px solid var(--border);
    padding-top: 0.65rem;
}

.rm-inputs-title {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--grey);
    margin: 0 0 0.15rem;
}

.rm-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rm-input-label {
    flex: 1;
    font-size: 0.7rem;
    color: var(--grey-light);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rm-input-field {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.rm-input {
    width: 62px;
    padding: 0.3rem 0.45rem;
    background: var(--surface);
    border: 1px solid var(--border-mid);
    border-radius: 8px;
    color: var(--white);
    font-size: 0.78rem;
    font-family: inherit;
    text-align: right;
    -moz-appearance: textfield;
}

.rm-input::-webkit-outer-spin-button,
.rm-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.rm-input:focus {
    outline: none;
    border-color: var(--border-focus);
}

.rm-input-unit {
    font-size: 0.65rem;
    color: var(--grey);
    min-width: 16px;
}

/* ══════════════════════════════════════════
   Clipboard — copier / couper / coller
   ══════════════════════════════════════════ */

/* Checkbox de bloc (haut-droite, visible au survol) */
.block-checkbox-wrap {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    opacity: 0;
    transition: opacity 0.15s;
    cursor: pointer;
}

.block-card-wrap:hover .block-checkbox-wrap { opacity: 1; }

.block-checkbox-wrap input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--active);
    cursor: pointer;
}

/* Quand la case est cochée, toujours visible */
.block-checkbox-wrap:has(input:checked) { opacity: 1; }

/* Bloc sélectionné — léger contour coloré */
.block-card-wrap:has(.block-checkbox:checked) .block-card {
    outline: 2px solid var(--active);
    outline-offset: -2px;
}

/* Checkbox de jour (haut-droite du header, visible au survol) */
.day-checkbox-wrap {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    opacity: 0;
    transition: opacity 0.15s;
    cursor: pointer;
}

.cal-day-header { position: relative; }
.cal-day:hover .day-checkbox-wrap  { opacity: 1; }
.day-checkbox-wrap:has(input:checked)      { opacity: 1; }
.day-checkbox-wrap:has(input:indeterminate){ opacity: 1; }

.day-checkbox-wrap input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--active);
    cursor: pointer;
}

/* Bouton "Coller" dans chaque jour */
.btn-paste-day {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    padding: 0.3rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #4ade80;
    background: rgba(74, 222, 128, 0.08);
    border: 1px dashed rgba(74, 222, 128, 0.35);
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    margin-bottom: 0.3rem;
}

.btn-paste-day:hover {
    background: rgba(74, 222, 128, 0.16);
    border-color: rgba(74, 222, 128, 0.6);
}

.btn-paste-day svg { width: 11px; height: 11px; flex-shrink: 0; }

/* Barres fixes en bas d'écran */
.clipboard-bar {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 800;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border-mid);
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
    white-space: nowrap;
    font-size: 0.78rem;
}

.clipboard-bar[hidden] { display: none; }

.clipboard-bar-cancel {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--grey);
    background: none;
    border: 1px solid var(--border-mid);
    border-radius: 3px;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    text-align: center;
    transition: color 0.15s, border-color 0.15s;
}

.clipboard-bar-cancel:hover { color: var(--white); border-color: var(--border-focus); }

.clipboard-bar-count {
    color: var(--grey-light);
    font-size: 0.75rem;
    text-align: center;
    padding: 0.1rem 0;
}

.clipboard-bar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.35rem 0.85rem;
    border-radius: 3px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

.clipboard-bar-btn svg { width: 11px; height: 11px; }

.clipboard-bar-btn--copy {
    color: var(--active);
    background: var(--active-bg);
    border-color: var(--active-border);
}

.clipboard-bar-btn--copy:hover { border-color: var(--active-border-strong); }

.clipboard-bar-btn--cut {
    color: #60a5fa;
    background: rgba(96,165,250,0.08);
    border-color: rgba(96,165,250,0.25);
}

.clipboard-bar-btn--cut:hover { border-color: rgba(96,165,250,0.45); }

.clipboard-bar-btn--delete {
    color: #ef4444;
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.3);
}

.clipboard-bar-btn--delete:hover { background: rgba(239,68,68,0.18); }

/* Barre presse-papier actif */
.clipboard-bar--paste .clipboard-bar-info {
    font-weight: 700;
    color: #4ade80;
    text-align: center;
}

.clipboard-bar--paste .clipboard-bar-hint {
    color: var(--grey);
    font-size: 0.72rem;
    text-align: center;
    line-height: 1.4;
    white-space: normal;
}

/* ══ Ticket modal (accessible depuis toutes les pages) ══ */
.ticket-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 900;
    background: var(--modal-backdrop);
    align-items: center;
    justify-content: center;
}
.ticket-modal-backdrop.is-open { display: flex; }

.ticket-modal {
    background: var(--surface-elevated);
    border: 1px solid var(--border-mid);
    border-radius: 8px;
    box-shadow: var(--modal-shadow);
    width: 100%;
    max-width: 480px;
    margin: 1rem;
}

.ticket-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.ticket-modal-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--white);
}

.ticket-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    color: var(--grey);
    cursor: pointer;
    transition: color 0.15s;
}
.ticket-modal-close svg { width: 14px; height: 14px; }
.ticket-modal-close:hover { color: var(--white); }

.ticket-modal-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 1.25rem 1.25rem;
}

.ticket-modal-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--grey-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ticket-modal-input,
.ticket-modal-textarea {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    border-radius: 4px;
    color: var(--white);
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
    font-family: inherit;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.ticket-modal-input:focus,
.ticket-modal-textarea:focus { outline: none; border-color: var(--border-focus); }
.ticket-modal-textarea { resize: vertical; min-height: 100px; }

.ticket-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

/* ══ Admin — liste des tickets ══ */
.ticket-filters {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.ticket-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--border-mid);
    color: var(--grey);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    user-select: none;
}
.ticket-filter-chip input { display: none; }

.ticket-filter-chip--open.is-active       { color: #4ade80; border-color: rgba(74,222,128,0.35); background: rgba(74,222,128,0.08); }
.ticket-filter-chip--in_progress.is-active { color: #60a5fa; border-color: rgba(96,165,250,0.35); background: rgba(96,165,250,0.08); }
.ticket-filter-chip--closed.is-active     { color: var(--grey-light); border-color: var(--border-mid); background: var(--hover-bg-strong); }

.ticket-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem 2rem;
}

.ticket-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ticket-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ticket-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--white);
}

.ticket-badge {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    flex-shrink: 0;
}
.ticket-badge--open        { color: #4ade80; background: rgba(74,222,128,0.1); }
.ticket-badge--in_progress { color: #60a5fa; background: rgba(96,165,250,0.1); }
.ticket-badge--closed      { color: var(--grey); background: var(--hover-bg-strong); }

.ticket-card-desc {
    font-size: 0.8rem;
    color: var(--grey-light);
    line-height: 1.5;
    margin: 0;
}

.ticket-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.25rem;
}

.ticket-card-meta {
    font-size: 0.72rem;
    color: var(--grey);
}

.ticket-status-form { margin: 0; }

.ticket-status-select {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border-mid);
    border-radius: 4px;
    color: var(--white);
    cursor: pointer;
    font-family: inherit;
}
.ticket-status-select:focus { outline: none; border-color: var(--border-focus); }

.ticket-empty {
    color: var(--grey);
    font-size: 0.82rem;
    text-align: center;
    padding: 3rem 0;
}

/* ══ Bibliothèque de médias ══ */
.section-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-form { display: flex; }
.search-input {
    font-size: 0.78rem;
    padding: 0.4rem 0.75rem;
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    border-radius: 4px;
    color: var(--white);
    font-family: inherit;
    width: 200px;
    transition: border-color 0.15s;
}
.search-input:focus { outline: none; border-color: var(--border-focus); }

.media-table-wrap {
    padding: 0 2rem 2rem;
    overflow-x: auto;
}

.media-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.media-table th {
    text-align: left;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--grey);
    padding: 0 0.75rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.media-row td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.media-row:last-child td { border-bottom: none; }
.media-row:hover td { background: var(--hover-bg); }

.media-name { font-weight: 600; color: var(--white); max-width: 200px; }
.media-desc { color: var(--grey-light); max-width: 200px; font-size: 0.78rem; }

.media-url-link {
    color: var(--grey-light);
    text-decoration: none;
    font-size: 0.78rem;
    max-width: 280px;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
.media-url-link:hover { color: var(--white); text-decoration: underline; }

.media-type-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
}
.media-type-badge--youtube { color: #f87171; background: rgba(248,113,113,0.1); }
.media-type-badge--none    { color: var(--grey); }

.media-owner { color: var(--grey-light); font-size: 0.78rem; }

.media-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.media-btn-edit,
.media-btn-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--grey);
    transition: color 0.15s, background 0.15s;
    text-decoration: none;
}
.media-btn-edit svg, .media-btn-delete svg { width: 13px; height: 13px; }
.media-btn-edit:hover  { color: var(--white); background: var(--hover-bg-strong); }
.media-btn-delete:hover { color: var(--danger); background: rgba(248,113,113,0.08); }

.media-delete-form { display: flex; }

/* ── Block media list (inside block form) ──────────────────────────────── */
.block-media-section label { display: block; margin-bottom: 0.5rem; }

.block-media-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.block-media-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.block-media-thumb {
    width: 56px;
    height: 42px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}

.block-media-thumb--empty {
    width: 56px;
    height: 42px;
    background: var(--surface-elevated);
    border-radius: 3px;
    flex-shrink: 0;
}

.block-media-name {
    flex: 1;
    min-width: 0;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--white);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.block-media-remove {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: none;
    background: none;
    color: var(--grey);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
}
.block-media-remove:hover { color: var(--danger); background: rgba(248,113,113,0.1); }

.btn-media-open {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--grey);
    background: none;
    border: 1px dashed var(--border-mid);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.btn-media-open:hover { color: var(--white); border-color: var(--border-focus); }

/* ── Full-screen media picker overlay ──────────────────────────────────── */
.media-picker-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: var(--surface);
    flex-direction: column;
    overflow: hidden;
}
.media-picker-overlay.is-open {
    display: flex;
}

.media-picker-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.media-picker-search {
    flex: 1;
    min-width: 0;
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    border-radius: 6px;
    color: var(--white);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}
.media-picker-search:focus { outline: none; border-color: var(--border-focus); }

.media-picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.media-picker-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.12s, border-color 0.12s;
}
.media-picker-row:hover { background: var(--surface-2); }
.media-picker-row.is-selected {
    background: var(--active-bg);
    border-color: var(--active-border);
}

.picker-cb {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--active);
    cursor: pointer;
}

.picker-thumb {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}

.picker-thumb--empty {
    width: 64px;
    height: 48px;
    background: var(--surface-2);
    border-radius: 3px;
    flex-shrink: 0;
}

.picker-name {
    flex: 1;
    min-width: 0;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--white);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.picker-url {
    font-size: 0.72rem;
    color: var(--grey);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 280px;
}

.picker-empty {
    font-size: 0.82rem;
    color: var(--grey);
    text-align: center;
    padding: 2rem 0;
}

/* ── Picker create-new-media footer ────────────────────────────────────── */
.media-picker-create {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface-2);
}

.media-picker-create-input {
    background: var(--surface);
    border: 1px solid var(--border-mid);
    border-radius: 6px;
    color: var(--white);
    font-size: 0.82rem;
    padding: 0.45rem 0.65rem;
    flex: 0 0 150px;
    min-width: 0;
}
.media-picker-create-url { flex: 1 1 auto; }
.media-picker-create-input:focus { outline: none; border-color: var(--border-focus); }

.btn-media-create {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--active);
    background: var(--active-bg);
    border: 1px solid var(--active-border);
    border-radius: 6px;
    padding: 0.45rem 0.85rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.btn-media-create:hover   { background: var(--active-border); border-color: var(--active-border-strong); }
.btn-media-create:disabled { opacity: 0.5; cursor: default; }
