/* =====================================================================
   Charte graphique du site (refonte 2026)
   ---------------------------------------------------------------------
   Toutes les couleurs sont définies ici, dans :root. Pour changer la
   couleur dominante du site, il suffit de modifier --primary et ses
   nuances. Les composants (boutons, cartes, onglets, formulaires...)
   sont décrits plus bas et réutilisés dans toutes les pages.
   ===================================================================== */

:root {
    /* Couleur dominante : bleu */
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-50: #EFF4FF;
    --primary-100: #DBE6FE;
    --primary-200: #BFD3FE;
    --primary-800: #1E40AF;
    --primary-900: #1E3A8A;

    /* Textes */
    --text: #0F172A;
    --text-2: #334155;
    --text-3: #475569;
    --muted: #64748B;

    /* Fonds et bordures */
    --bg: #F5F7FB;
    --surface: #FFFFFF;
    --surface-2: #F8FAFC;
    --border: #E2E8F0;
    --border-strong: #CBD5E1;

    /* États */
    --danger: #B91C1C;
    --danger-bg: #FEF2F2;
    --success: #15803D;
    --success-bg: #F0FDF4;

    /* Genre (pastilles des membres) */
    --male-bg: #E0E7FF;
    --male-fg: #3730A3;
    --female-bg: #FCE7F3;
    --female-fg: #9D174D;
    --female-solid: #BE185D;

    /* Couleurs complémentaires (étaient écrites en dur) */
    --primary-solid: #2563EB;        /* fond des boutons pleins, texte blanc dessus */
    --primary-solid-hover: #1D4ED8;
    --placeholder: #94A3B8;
    --border-soft: #F1F5F9;
    --dropzone-bg: #F8FAFF;
    --success-border: #BBF7D0;
    --danger-border: #FECACA;

    /* Roue de la descendance (public/descendance2.js) */
    --w2-bg: #FFFFFF;
    --w2-ink: #111827;
    --w2-ink-2: #1F2937;
    --w2-muted: #6B7280;
    --w2-muted-2: #4B5563;
    --w2-guide: #D1D5DB;
    --w2-halo: rgba(255, 255, 255, .75);
    --w2-tint: 1;                    /* force de la teinte des cases */

    /* Arbre généalogique (public/descendance.js) */
    --tree-node: #E0F0FF;
    --tree-line: #999999;
    --tree-name: #1A56DB;
    --tree-spouse: #777777;

    --radius: 16px;
    --radius-sm: 10px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Mode sombre ----------
   <html data-theme="dark"> est posé par le script en tête de layouts/app.blade.php,
   selon le choix de l'utilisateur (Réglages) ou le réglage de son appareil. */
:root[data-theme="dark"] {
    color-scheme: dark;

    --primary: #60A5FA;
    --primary-hover: #93C5FD;
    --primary-50: #1B2A4A;
    --primary-100: #1E3A8A;
    --primary-200: #2563EB;
    --primary-800: #BFDBFE;
    --primary-900: #DBEAFE;
    --primary-solid: #2563EB;
    --primary-solid-hover: #3B82F6;

    --text: #F1F5F9;
    --text-2: #E2E8F0;
    --text-3: #CBD5E1;
    --muted: #94A3B8;

    --bg: #0B1220;
    --surface: #162033;
    --surface-2: #1C2942;
    --border: #2B3A55;
    --border-strong: #3F5071;

    --danger: #FCA5A5;
    --danger-bg: #3A1418;
    --success: #86EFAC;
    --success-bg: #0F2E1D;

    --male-bg: #312E81;
    --male-fg: #C7D2FE;
    --female-bg: #831843;
    --female-fg: #FBCFE8;
    --female-solid: #EC4899;

    --placeholder: #64748B;
    --border-soft: #22304A;
    --dropzone-bg: #18243C;
    --success-border: #166534;
    --danger-border: #7F1D1D;

    --w2-bg: #162033;
    --w2-ink: #F1F5F9;
    --w2-ink-2: #E2E8F0;
    --w2-muted: #B6C2D4;
    --w2-muted-2: #CBD5E1;
    --w2-guide: #3F5071;
    --w2-halo: rgba(11, 18, 32, .7);
    --w2-tint: 1.7;

    --tree-node: #1B2A4A;
    --tree-line: #64748B;
    --tree-name: #93C5FD;
    --tree-spouse: #B6C2D4;
}
:root { color-scheme: light; }

/* Anciennes règles de style.css écrites en clair */
:root[data-theme="dark"] h2 { color: var(--text); }
:root[data-theme="dark"] #wheel.expanded,
:root[data-theme="dark"] #tree.expanded { background-color: var(--bg); }

/* Arbre généalogique : couleurs par variables, dans les deux modes */
/* Arbre généalogique (public/descendance.js, partial livewire/partials/tree-chart) */
.tree-chart { display: flex; flex-direction: column; gap: 12px; }
.tree-toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.tree-search { position: relative; flex: 1 1 260px; max-width: 360px; }
.tree-results {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; list-style: none; margin: 0; padding: 6px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .14); max-height: 320px; overflow-y: auto;
}
.tree-results[hidden] { display: none; }
.tree-results button {
    width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; cursor: pointer;
    background: none; border: 0; padding: 10px 12px; border-radius: 8px; font: inherit; font-size: 15px; color: var(--text);
}
.tree-results button:hover, .tree-results button:focus-visible { background: var(--surface-2); outline: none; }
.tree-result-meta { font-size: 13px; color: var(--muted); }
.tree-result-empty { padding: 10px 12px; font-size: 14px; color: var(--muted); }
.tree-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.tree-canvas { position: relative; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.tree-canvas svg { display: block; width: 100%; height: 68vh; min-height: 440px; cursor: grab; touch-action: none; user-select: none; }
.tree-canvas svg:active { cursor: grabbing; }
.tree-hint { margin: 0; font-size: 13px; color: var(--muted); }
.tree-chart.is-fullscreen { position: fixed; inset: 0; z-index: 9998; background: var(--bg); padding: 16px; overflow: auto; }
.tree-chart.is-fullscreen .tree-canvas svg { height: calc(100vh - 150px); min-height: 0; }
.tree-tooltip {
    position: absolute; z-index: 30; pointer-events: none; max-width: 260px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .14); padding: 10px 12px; font-size: 13px; line-height: 1.45; color: var(--text);
}
.tree-tooltip[hidden] { display: none; }
.tc-node { cursor: pointer; outline: none; transition: opacity .15s; }
.tc-node.is-dim, .tc-link.is-dim { opacity: .22; }
.tc-node:focus-visible .tc-frame, .tc-node.is-focus .tc-frame, .tc-node.is-found .tc-frame { stroke: var(--primary); stroke-width: 3; }
/* Membre de la fiche d'où l'on vient (lien « Arbre » du bandeau) : sa carte ressort légèrement */
/* !important : la couleur du cadre est posée en style par public/descendance.js (teinte de la branche) */
.tc-node .is-origine .tc-frame, .tc-node.is-origine .tc-frame { stroke: var(--primary) !important; stroke-width: 3; }
.tc-node .is-origine, .tc-node.is-origine { filter: drop-shadow(0 0 10px rgba(37, 99, 235, .55)); }
.tc-link { fill: none; stroke: var(--tree-line); stroke-width: 1.6; transition: opacity .15s; }
.tc-link.is-path { stroke: var(--primary); }
/* Ascendants (parents de la personne en tête) : grisés, ils indiquent qu'on remonte dans l'arbre */
.tc-ascendant { opacity: .55; filter: grayscale(.7); }
/* Personne d'une famille où l'on n'est pas invité : grisée, sans lien (MemberService, carte #63) */
.tc-node-off { cursor: default; opacity: .5; filter: grayscale(1); }
.tc-node-off .tc-frame { stroke-dasharray: 5 4; }
.tc-ascendant.tc-node-off:hover { opacity: .5; filter: grayscale(1); }
.w2-sector.w2-off { cursor: default; }
/* Membre de la fiche d'où l'on vient (lien « Roue » du bandeau) : sa case, ou le disque central, ressort.
   !important : le trait des cases est posé en style par public/descendance2.js */
.w2-sector.w2-origine .w2-arc { stroke: var(--primary) !important; stroke-width: 4; }
.w2-sector.w2-origine, .w2-origine > circle { filter: drop-shadow(0 0 10px rgba(37, 99, 235, .55)); }
.w2-origine > circle { stroke: var(--primary); stroke-width: 5; }
.person-off, .person-off:hover { background: none; color: var(--muted); cursor: default; }
.person-off .avatar { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--border); }
.chip-off, .chip-off:hover { color: var(--muted); border-style: dashed; border-color: var(--border); cursor: default; }
.tc-ascendant:hover, .tc-ascendant:focus-visible { opacity: 1; filter: none; }
.tc-link-ascendant { stroke-dasharray: 5 5; opacity: .7; }

/* ---------- Base ---------- */
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}
a:hover { text-decoration: none; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
[x-cloak] { display: none !important; }

/* ---------- En-tête et navigation ---------- */
.app-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
.app-nav {
    max-width: 1600px; margin: 0 auto; padding: 12px clamp(16px, 3vw, 40px);
    display: flex; align-items: center; gap: 16px;
}
.app-brand {
    display: flex; align-items: center; gap: 10px;
    color: var(--text); font-weight: 700; font-size: 18px;
}
.app-brand:hover { color: var(--text); }
/* Titre et numéro de version du site, l'un sous l'autre */
.app-brand-texte { display: flex; flex-direction: column; line-height: 1.15; }
.app-version { margin-top: 3px; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .02em; }
.app-brand-icon {
    width: 36px; height: 36px; border-radius: 10px; background: var(--primary-solid);
    display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
/* Baseline à côté du logo, dans la police du site : « racine » en couleur principale */
.app-baseline {
    margin: 0 0 0 4px; padding-left: 16px; border-left: 1px solid var(--border-strong);
    font-size: 15px; font-weight: 500; line-height: 1.2; color: var(--muted); white-space: nowrap;
}
.app-baseline strong { font-weight: 700; color: var(--primary); }
@media (max-width: 1180px) { .app-baseline { display: none; } }
.app-menu { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav-link {
    color: var(--text-2); font-size: 15px; font-weight: 500;
    padding: 10px 14px; border-radius: 8px;
    display: inline-flex; align-items: center;
}
.nav-link:hover { background: var(--primary-50); color: var(--primary-900); }
.nav-link.is-active { background: var(--primary-50); color: var(--primary); font-weight: 600; }

.user-btn {
    width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--border-strong); background: var(--primary-100);
    color: var(--primary-900); font-weight: 700; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.user-btn:hover { border-color: var(--primary); }
.dropdown {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .12); padding: 6px; z-index: 60;
}
.dropdown-head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px 12px; border-radius: 8px; font-size: 15px; color: var(--text-2);
    background: none; border: 0; cursor: pointer; text-align: left;
}
.dropdown-item:hover { background: var(--surface-2); color: var(--text); }
/* Bascule clair / sombre : on propose le thème opposé à celui affiché */
.theme-toggle > span { display: flex; align-items: center; gap: 10px; }
:root[data-theme="dark"] .theme-toggle-vers-sombre,
:root:not([data-theme="dark"]) .theme-toggle-vers-clair { display: none; }

/* Barre de recherche de l'en-tête */
.header-search { width: clamp(220px, 26vw, 380px); margin-right: 8px; }
.header-search-field {
    display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 8px 0 16px;
    border-radius: 999px; border: 1px solid transparent; background: var(--bg);
    color: var(--muted); cursor: text;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.header-search-field:hover { background: var(--primary-50); }
.header-search-field:focus-within {
    background: var(--surface); border-color: var(--primary); color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-100), 0 8px 24px rgba(37, 99, 235, .12);
}
.header-search-field svg { width: 18px; height: 18px; flex-shrink: 0; }
.header-search-field input {
    flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
    font: inherit; font-size: 15px; color: var(--text);
}
.header-search-field input::placeholder { color: var(--placeholder); }
.header-search-field input::-webkit-search-cancel-button { cursor: pointer; }
.header-search-kbd {
    flex-shrink: 0; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.header-search-field:focus-within .header-search-kbd { display: none; }

/* Panneau de résultats : toute la largeur, sous l'en-tête (positionné par rapport à .app-header) */
.header-search-panel {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 55;
    background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
    box-shadow: 0 24px 48px rgba(15, 23, 42, .14);
    max-height: calc(100vh - 90px); overflow-y: auto;
}
.header-search-inner {
    max-width: 1600px; margin: 0 auto; padding: 20px clamp(16px, 3vw, 40px) 28px;
    display: grid; grid-template-columns: 1fr 2fr; gap: 32px; align-items: start;
}
.header-search-col { min-width: 0; }
.header-search-title {
    display: flex; align-items: center; gap: 8px; margin: 0 0 12px;
    font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.header-search-empty { margin: 0; padding: 16px 0; font-size: 15px; color: var(--muted); }
.header-search-none { grid-column: 1 / -1; text-align: center; padding: 24px 0; }
.header-search-panel .header-search-members { padding: 0; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.header-search-panel .member-card, .search-family-card { background: var(--surface); transition: border-color .15s, box-shadow .15s, transform .15s; }
.header-search-panel .member-card:hover, .search-family-card:hover {
    border-color: var(--primary); box-shadow: 0 8px 20px rgba(37, 99, 235, .12); transform: translateY(-2px);
}
.search-member-families {
    max-width: 100%; font-size: 12px; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-family-card {
    display: flex; align-items: flex-start; gap: 14px; padding: 16px;
    border: 1px solid var(--border); border-radius: 14px; color: var(--text);
}
.search-family-card + .search-family-card { margin-top: 12px; }
.search-family-card:hover { color: var(--text); }
.search-family-icon {
    width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px;
    background: var(--primary-50); color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
}
.search-family-icon svg { width: 22px; height: 22px; }
.search-family-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.search-family-name { font-weight: 600; font-size: 16px; }
.search-family-desc { font-size: 14px; color: var(--text-3); line-height: 1.4; }

.menu-toggle { display: none; }
@media (max-width: 860px) {
    .app-nav { flex-wrap: wrap; }
    .menu-toggle {
        display: inline-flex; margin-left: auto; width: 44px; height: 44px;
        align-items: center; justify-content: center; border-radius: 10px;
        border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); cursor: pointer;
    }
    .app-menu { display: none; width: 100%; flex-direction: column; align-items: stretch; margin-left: 0; }
    .app-menu.is-open { display: flex; }
    .app-menu .nav-link { padding: 12px 14px; }
    .header-search { width: 100%; margin: 8px 0; position: relative; }
    .header-search-kbd { display: none; }
    .header-search-panel {
        top: calc(100% + 8px); border: 1px solid var(--border); border-radius: 14px;
        max-height: 65vh;
    }
    .header-search-inner { grid-template-columns: 1fr; gap: 20px; padding: 16px; }
    .header-search-panel .header-search-members { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* ---------- Conteneur de page ---------- */
.page { max-width: 1600px; margin: 0 auto; padding: 24px clamp(16px, 3vw, 40px); }
.breadcrumb {
    font-size: 14px; color: var(--muted);
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}
.breadcrumb a { color: var(--primary-hover); }
.breadcrumb a:hover { color: var(--primary-900); }
.breadcrumb [aria-current] { color: var(--text); font-weight: 500; }

.page-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
}
.page-title { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); text-align: left; }
.page-subtitle { margin: 6px 0 0; color: var(--text-3); font-size: 16px; }

/* ---------- Cartes ---------- */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
}
.card-lg { padding: 28px; }
.card-flush { padding: 0; overflow: hidden; }
.card-title { margin: 0 0 4px; font-size: 18px; font-weight: 600; color: var(--text); text-align: left; }
.card-intro { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.section-label {
    margin: 16px 0 4px; font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.section-label:first-of-type { margin-top: 4px; }

/* En-tête de profil (membre / famille) */
.profile {
    display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
}
.profile-main { flex: 1 1 320px; min-width: 0; }
.profile-name { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: -0.02em; text-align: left; color: var(--text); }
.profile-meta { margin: 6px 0 14px; color: var(--text-3); font-size: 16px; }
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; }
.stat-value { font-size: 24px; font-weight: 700; }
.stat-label { font-size: 14px; color: var(--muted); }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
    font: inherit; font-size: 15px; font-weight: 600; line-height: 1;
    border: 1px solid transparent; cursor: pointer; white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary { background: var(--primary-solid); color: #fff; }
.btn-primary:hover { background: var(--primary-solid-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary-900); }
.btn-outline { background: var(--surface); color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-50); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-icon { width: 44px; padding: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, .nav-link:focus-visible, .tab:focus-visible, .user-btn:focus-visible {
    outline: 3px solid var(--primary-200); outline-offset: 2px;
}

/* ---------- Onglets ---------- */
.tabs {
    display: flex; gap: 28px; border-bottom: 1px solid var(--border);
    margin: 24px 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.tab {
    padding: 14px 2px; font: inherit; font-size: 15px; font-weight: 500; color: var(--text-3);
    background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
    display: inline-flex; gap: 8px; align-items: center; cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.badge {
    font-size: 12px; font-weight: 600; background: var(--border); color: var(--text-2);
    padding: 2px 8px; border-radius: 999px;
}
.tab.is-active .badge { background: var(--primary-100); color: var(--primary-900); }

/* ---------- Pastilles, avatars, personnes ---------- */
.chip {
    display: inline-flex; align-items: center; font-size: 13px; font-weight: 500;
    padding: 6px 12px; border-radius: 999px; background: var(--primary-50); color: var(--primary-800);
}
.chip:hover { background: var(--primary-100); color: var(--primary-900); }
.chip-outline { background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 14px; padding: 8px 14px; }
.chip-outline:hover { border-color: var(--primary); background: var(--surface); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
/* Famille où l'utilisateur n'est pas invité : grisée, non cliquable, infobulle au survol et au focus */
.chip-off, .chip-off:hover {
    position: relative; cursor: default;
    background: var(--surface-2); color: var(--muted); border: 1px dashed var(--border-strong);
}
.chip-off:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.chip-off::after {
    content: attr(data-tooltip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
    padding: 6px 10px; border-radius: 8px; background: var(--text); color: var(--surface);
    font-size: 13px; font-weight: 500; white-space: nowrap; pointer-events: none;
    opacity: 0; visibility: hidden; transition: opacity .15s; z-index: 20;
}
.chip-off:hover::after, .chip-off:focus::after { opacity: 1; visibility: visible; }

.avatar {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; background: var(--primary-100); color: var(--primary-900);
    object-fit: cover; overflow: hidden;
}
.avatar-m { background: var(--male-bg); color: var(--male-fg); }
.avatar-f { background: var(--female-bg); color: var(--female-fg); }
.avatar-lg { width: 112px; height: 112px; font-size: 38px; }
.avatar-md { width: 88px; height: 88px; font-size: 30px; }

.person {
    display: flex; align-items: center; gap: 12px; padding: 8px 10px; margin: 0 -10px;
    border-radius: 10px; color: var(--text); min-height: 44px;
}
.person:hover { background: var(--surface-2); color: var(--text); }
.person-name { flex: 1; min-width: 0; }
.person-note { color: var(--muted); font-size: 14px; }
.person svg { width: 16px; height: 16px; color: #94A3B8; }

/* Liste de définitions (Informations) */
.info-list {
    margin: 0; display: grid; grid-template-columns: 140px 1fr;
    row-gap: 14px; column-gap: 16px; font-size: 15px;
}
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; font-weight: 500; }

/* Grilles */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 24px; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.photo { margin: 0; }
.photo img, .photo-ph {
    width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: var(--border); display: block;
}
.photo figcaption {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    font-size: 14px; color: var(--text-3); margin-top: 6px;
}

/* Visionneuse de photos (public/lightbox.js) : fond sombre dans les deux modes */
body.lightbox-open { overflow: hidden; }
.lightbox {
    position: fixed; inset: 0; z-index: 10000; display: flex; flex-direction: column;
    background: rgba(2, 6, 23, .94); color: #F1F5F9;
}
.lightbox[hidden], .lightbox [hidden] { display: none !important; }
.lightbox-top {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; flex-wrap: wrap;
}
.lightbox-counter { font-size: 14px; color: #CBD5E1; font-variant-numeric: tabular-nums; }
.lightbox-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lightbox-tools button, .lightbox-tools a {
    min-width: 40px; min-height: 40px; padding: 0 12px; border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #F8FAFC;
    font: inherit; font-size: 14px; display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none; cursor: pointer;
}
.lightbox-tools button:hover, .lightbox-tools a:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.lightbox-tools button:focus-visible, .lightbox-tools a:focus-visible, .lightbox-nav:focus-visible {
    outline: 3px solid #60A5FA; outline-offset: 2px;
}
.lightbox-stage {
    position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
    overflow: hidden; touch-action: none;
}
.lightbox-stage img {
    max-width: 92%; max-height: 100%; object-fit: contain; border-radius: 6px;
    user-select: none; -webkit-user-drag: none; cursor: zoom-in; transition: transform .12s ease-out;
}
.lightbox-stage img.is-zoomed { cursor: grab; transition: none; }
.lightbox-error { color: #FCA5A5; font-size: 16px; }
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 1;
    width: 48px; height: 48px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(15, 23, 42, .6); color: #fff; font: inherit; font-size: 28px; line-height: 1; cursor: pointer;
}
.lightbox-nav:hover { background: rgba(30, 41, 59, .95); }
.lightbox-nav.prev { left: 12px; }
.lightbox-nav.next { right: 12px; }
.lightbox-caption { padding: 12px 16px 18px; text-align: center; }
.lightbox-meta { font-size: 13px; color: #94A3B8; }
.lightbox-text { font-size: 16px; margin-top: 4px; color: #F1F5F9; }
.photo img[data-lightbox], .photo-grid img[data-lightbox] { cursor: zoom-in; }

/* Albums photo */
.album-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.album-card {
    display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; cursor: pointer;
    font: inherit; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 14px;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.album-card:hover { border-color: var(--primary); box-shadow: 0 8px 20px rgba(37, 99, 235, .12); transform: translateY(-2px); }
.album-card:focus-visible { outline: 3px solid var(--primary-200); border-color: var(--primary); }
.album-cover { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--border); }
.album-cover-empty { display: flex; align-items: center; justify-content: center; background: var(--primary-50); color: var(--primary); }
.album-cover-empty svg { width: 40px; height: 40px; }
.album-card-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; min-width: 0; }
.album-card-title { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-card-meta { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.album-description { margin: 6px 0 0; color: var(--text-3); font-size: 15px; line-height: 1.5; white-space: pre-line; max-width: 760px; }
.album-meta { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.album-share { border: 0; padding: 0; margin-left: 0; margin-right: 0; min-width: 0; }
.chip-private, .chip-private:hover { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.photo figcaption span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.form-textarea { min-height: 96px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.form-optional { font-weight: 400; color: var(--muted); }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; color: var(--text); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

.empty {
    text-align: center; padding: 40px 16px; color: var(--muted); font-size: 15px;
}

/* ---------- Formulaires ---------- */
.form-label { display: block; font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.form-input {
    width: 100%; box-sizing: border-box; min-height: 46px; padding: 0 14px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    font: inherit; font-size: 15px; color: var(--text); background: var(--surface);
}
.form-input::placeholder { color: var(--placeholder); }
.form-input:focus { outline: 3px solid var(--primary-200); border-color: var(--primary); }
.form-help { font-size: 13px; color: var(--muted); margin-top: 6px; }
.form-error { font-size: 13px; color: var(--danger); margin-top: 6px; display: block; }

.search { position: relative; display: block; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search .form-input { padding-left: 42px; }

.segmented {
    display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: 4px; gap: 4px; background: var(--surface-2);
}
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span {
    display: block; padding: 9px 22px; border-radius: 8px; font-size: 15px; font-weight: 500; color: var(--text-2);
    transition: background 180ms ease, color 180ms ease;
}
.segmented input:checked + span { background: var(--primary-solid); color: #fff; font-weight: 600; }
.segmented label.gender-f input:checked + span { background: var(--female-solid); }
.segmented input:focus-visible + span { outline: 3px solid var(--primary-200); }

/* Pill glissant pour le sélecteur de genre */
.segmented-gender { position: relative; }
.segmented-pill {
    position: absolute; top: 4px; bottom: 4px; border-radius: 8px; pointer-events: none; z-index: 0;
    transition: left 260ms cubic-bezier(.4,0,.2,1), width 260ms cubic-bezier(.4,0,.2,1), background-position 260ms cubic-bezier(.4,0,.2,1);
}
.segmented-gender label { position: relative; z-index: 1; }
.segmented-gender input:checked + span { background: transparent; }
.segmented-gender label.gender-f input:checked + span { background: transparent; }

/* Page Réglages : choix de l'apparence */
.theme-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; border: 0; padding: 0; margin: 0; min-width: 0; }
.theme-option { position: relative; cursor: pointer; display: block; }
.theme-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.theme-option-box {
    display: flex; flex-direction: column; gap: 6px; height: 100%; box-sizing: border-box; padding: 16px;
    border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
}
.theme-option:hover .theme-option-box { border-color: var(--primary); }
.theme-option input:checked + .theme-option-box { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); background: var(--primary-50); }
.theme-option input:focus-visible + .theme-option-box { outline: 3px solid var(--primary-200); }
.theme-option-title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; color: var(--text); }
.theme-option-title svg { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; }
.theme-option-desc { font-size: 14px; color: var(--text-3); line-height: 1.45; }

/* Suggestions (recherche de parent / conjoint) */
.suggestions {
    margin-top: 8px; border: 1px solid var(--border); border-radius: 12px;
    background: var(--surface); padding: 6px; box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}
.suggestions-head { font-size: 13px; color: var(--muted); padding: 6px 10px; }
.suggestion {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
    border-radius: 8px; border: 0; background: none; font: inherit; font-size: 15px;
    color: var(--text); cursor: pointer; text-align: left;
}
.suggestion:hover { background: var(--primary-50); }

.relation {
    display: flex; align-items: center; gap: 14px; padding: 12px 14px;
    border: 1px solid var(--border); border-radius: 12px; flex-wrap: wrap;
}
.relation + .relation { margin-top: 10px; }

.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    padding: 32px; border: 2px dashed var(--primary-200); border-radius: 14px;
    background: var(--dropzone-bg); text-align: center; cursor: pointer; position: relative;
}
.dropzone:hover { border-color: var(--primary); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone svg { width: 32px; height: 32px; color: var(--primary); }

.save-bar {
    display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 16px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}

/* Mise en page avec sommaire latéral (édition) */
/* Menu de rubriques à gauche, une rubrique affichée à la fois (public/rubriques.js) :
   pages Réglages, modification d'un membre, modification d'un utilisateur */
.rubriques-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; width: 100%; }
.rubriques-nav {
    position: sticky; top: 88px; display: flex; flex-direction: column; gap: 4px;
    padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.rubriques-item {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 14px;
    border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2);
    font: inherit; font-size: 15px; font-weight: 500; text-align: left; cursor: pointer; white-space: nowrap;
}
.rubriques-item svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--muted); }
.rubriques-item:hover { background: var(--surface-2); color: var(--text); }
.rubriques-item[aria-selected="true"] { background: var(--primary-50); color: var(--primary-900); font-weight: 600; }
.rubriques-item[aria-selected="true"] svg { color: var(--primary); }
/* Variante en liens d'ancre (page « Ajouter un membre ») : la section à l'écran est marquée aria-current */
a.rubriques-item { text-decoration: none; }
/* Page « Ajouter un membre » : colonne de gauche fixe (menu + Annuler / Ajouter le membre) */
.ajout-colonne { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 12px; }
.ajout-colonne .rubriques-nav { position: static; }
.ajout-actions { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ajout-actions .btn { width: 100%; justify-content: flex-start; }
.ajout-avatar svg { width: 48px; height: 48px; }
/* Rond du haut : le picto tant que ni prénom ni nom n'est tapé, sinon seulement les initiales */
.ajout-avatar [data-ajout-initiales] { display: none; }
.ajout-avatar.a-initiales [data-ajout-initiales] { display: inline; }
.ajout-avatar.a-initiales svg { display: none; }
.ajout-photo-rond svg { width: 34px; height: 34px; }
.ajout-entete-actions { margin-left: auto; align-self: flex-start; }
.ajout-photo { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
/* Bloc choisi dans le menu : les autres blocs du formulaire sont grisés, avec une transition douce */
#form-ajout-membre > .card { transition: opacity .35s ease, filter .35s ease, box-shadow .35s ease, border-color .35s ease; }
#form-ajout-membre.sections-focus > .card:not(.is-focus) { opacity: .45; filter: grayscale(.6); }
#form-ajout-membre.sections-focus > .card.is-focus { border-color: var(--primary-200); box-shadow: 0 0 0 3px var(--primary-50); }
@media (prefers-reduced-motion: reduce) { #form-ajout-membre > .card { transition: none; } }
.ajout-actions-bas { display: none; }
@media (max-width: 860px) {
    .ajout-colonne { position: static; }
    .ajout-actions-menu { display: none; }
    .ajout-actions-bas { display: flex; }
}
.rubriques-item[aria-current="true"] { background: var(--primary-50); color: var(--primary-900); font-weight: 600; }
.rubriques-item[aria-current="true"] svg { color: var(--primary); }
.rubriques-item:focus-visible { outline: 3px solid var(--primary-200); outline-offset: 1px; }
.rubriques-panel[hidden] { display: none; }

/* Menu de gauche réductible (bouton <x-rubriques-reduire />, état data-menu-reduit sur <html>,
   mémorisé par le script de layouts/app.blade.php) : réduit, il ne garde que les pictos.
   La colonne rétrécit en douceur ; le bouton, calé à droite, glisse avec elle jusqu'au-dessus des pictos. */
.rubriques-reduire { display: flex; justify-content: flex-end; }
.rubriques-reduire-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 38px; flex-shrink: 0;
    border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer;
}
.rubriques-reduire-btn:hover { background: var(--surface-2); color: var(--text); }
.rubriques-reduire-btn:focus-visible { outline: 3px solid var(--primary-200); outline-offset: 1px; }
.rubriques-reduire-chevron { transform-box: fill-box; transform-origin: center; transition: transform .3s ease; }
.rubriques-layout { transition: grid-template-columns .3s ease; }
.rubriques-nav { overflow: hidden; }
.rubriques-label, .rubriques-item .badge { transition: opacity .2s ease; }
@media (min-width: 861px) {
    html[data-menu-reduit] .rubriques-layout { grid-template-columns: 66px minmax(0, 1fr); }
    html[data-menu-reduit] .rubriques-label,
    html[data-menu-reduit] .rubriques-item .badge { opacity: 0; }
    html[data-menu-reduit] .rubriques-reduire-chevron { transform: rotate(180deg); }
    /* Page « Ajouter un membre » : les boutons Annuler / Ajouter ne tiennent plus dans la colonne, ils passent en bas */
    html[data-menu-reduit] .ajout-actions-menu { display: none; }
    html[data-menu-reduit] .ajout-actions-bas { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
    .rubriques-layout, .rubriques-label, .rubriques-item .badge, .rubriques-reduire-chevron { transition: none; }
}
.rubriques-panel > .stack, .rubriques-panel > form.stack, .rubriques-panel.stack { gap: 16px; }
/* Petits écrans : le menu passe au-dessus, en ligne défilante */
@media (max-width: 860px) {
    .rubriques-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .rubriques-nav { position: static; flex-direction: row; overflow-x: auto; }
    .rubriques-reduire { display: none; }
    .rubriques-item { width: auto; flex: 0 0 auto; white-space: nowrap; }
}

/* ---------- Tableaux ---------- */
.toolbar {
    padding: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
}
.toolbar .search { flex: 1 1 320px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); text-align: left; padding: 12px 16px;
    background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td {
    padding: 12px 16px; border-bottom: 1px solid var(--border-soft); font-size: 15px;
    color: var(--text-2); white-space: nowrap;
}
.data-table tbody tr:hover td { background: var(--surface-2); }
/* Page d'une famille : « Créée par … le … » sous le nom */
.family-creator { display: flex; align-items: center; gap: 8px; margin: -4px 0 12px; font-size: 14px; color: var(--muted); }
.family-creator svg { width: 16px; height: 16px; flex-shrink: 0; }
.family-creator strong { color: var(--text-2); font-weight: 600; }
/* Cellule de nom qui peut passer sur deux lignes, pour que le tableau tienne sans défilement horizontal */
.data-table td.cell-wrap { white-space: normal; min-width: 120px; overflow-wrap: anywhere; }
.data-table .member-link { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 600; }
.data-table .member-link:hover { color: var(--primary); }
.table-footer { padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid var(--border); }
.pagination-nav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pagination-btn { min-height: 32px !important; padding: 0 10px !important; font-size: 13px !important; }
.pagination-btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.pagination-ellipsis { padding: 0 6px; color: var(--muted); font-size: 13px; line-height: 32px; }

/* Grille de cartes membres (vue « Grille ») */
.member-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; padding: 16px; }
.member-card {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
    padding: 20px 16px; border: 1px solid var(--border); border-radius: 14px; color: var(--text);
}
.member-card:hover { border-color: var(--primary); color: var(--text); }
.member-card .avatar { width: 72px; height: 72px; font-size: 24px; margin-bottom: 6px; }
.member-card-name { font-weight: 600; }
.member-card-meta { font-size: 13px; color: var(--muted); }

/* ---------- Graphiques (arbre, roues) ---------- */
.chart-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chart-toolbar .hint { margin-left: auto; font-size: 14px; color: var(--muted); }
.chart-box { overflow: hidden; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.chart-expand { cursor: pointer; width: 20px; height: 20px; color: var(--text-3); }

/* ---------- Messages flash ---------- */
.alert {
    position: fixed; right: 24px; top: 84px; z-index: 70; max-width: 380px;
    padding: 14px 18px; border-radius: 12px; border: 1px solid; font-size: 15px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .12); margin: 0; color: var(--text);
}
.alert-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.alert-danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }

/* Les graphiques D3 occupent la largeur de leur bloc (et non plus tout l'écran) */
#svg, #family-tree { width: 100%; height: 72vh; min-height: 480px; display: block; cursor: grab; }
#wheel.expanded #svg, #tree.expanded #family-tree { height: calc(100vh - 80px); }

/* ---------- Pages de connexion / compte ---------- */
.auth-wrap { min-height: calc(100vh - 160px); display: flex; align-items: center; justify-content: center; padding: 24px 0; }
.auth-card { width: 100%; max-width: 460px; }
.auth-card .card-title { font-size: 24px; letter-spacing: -0.01em; }
.auth-forgot { display: table; margin: 8px 0 0 auto; font-size: 14px; font-weight: 500; }
.auth-footer { margin-top: 20px; text-align: center; font-size: 15px; color: var(--text-3); }
.auth-separator { display: flex; align-items: center; gap: 12px; margin: 20px 0; font-size: 14px; color: var(--text-3); }
.auth-separator::before, .auth-separator::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.field + .field { margin-top: 16px; }

/* ---------- Accueil ---------- */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.shortcut { display: flex; align-items: center; gap: 16px; padding: 20px; color: var(--text); }
.shortcut:hover { border-color: var(--primary); color: var(--text); }
.shortcut-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--primary-50); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.shortcut-icon svg { width: 24px; height: 24px; }

/* Cartes de familles */
.family-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.family-card { display: flex; flex-direction: column; gap: 12px; }
.family-card-title { margin: 0; font-size: 20px; font-weight: 700; text-align: left; }
.family-card-title a { color: var(--text); }
.family-card-title a:hover { color: var(--primary); }
.family-card-desc { color: var(--text-3); font-size: 15px; line-height: 1.5; margin: 0; flex: 1; }
.family-card-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.family-card-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }

/* ---------- Pages publiques : accueil du visiteur, pages « Bientôt disponible », pied de page ---------- */
/* En-tête du visiteur : les deux boutons restent groupés à droite du menu */
.nav-actions { display: inline-flex; gap: 8px; margin-left: 12px; }
@media (max-width: 860px) {
    .nav-actions { margin: 8px 0 4px; flex-direction: column; }
}

.home { display: flex; flex-direction: column; gap: 56px; padding-bottom: 24px; }
/* Slider puis bloc de connexion, chacun sur toute la largeur */
.home-hero { display: flex; flex-direction: column; gap: 24px; }

/* Slider (public/accueil.js) */
.slider {
    position: relative; display: flex; flex-direction: column; min-height: 520px; overflow: hidden;
    background: linear-gradient(140deg, var(--primary-50), var(--surface) 70%);
    border: 1px solid var(--border); border-radius: var(--radius);
}
.slider-track { flex: 1; display: flex; }
.slide { display: none; flex: 1; flex-direction: column; gap: 20px; padding: 32px 32px 0; min-width: 0; }
.slide.is-active { display: flex; }
.slider.is-ready .slide.is-active { animation: slide-apparition .45s ease; }
@keyframes slide-apparition { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .slider.is-ready .slide.is-active { animation: none; } }
.slide-text { max-width: 620px; }
.slide-title { text-align: left; margin: 0 0 10px; font-size: clamp(26px, 3.2vw, 40px); line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; color: var(--text); text-wrap: balance; }
.slide-text p { margin: 0; font-size: 17px; line-height: 1.5; color: var(--text-3); }
/* La capture sort du bas de la diapositive, comme une fenêtre posée derrière le bord */
.slide-image {
    flex: 1; min-height: 220px; margin-bottom: 56px; overflow: hidden;
    border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface);
    box-shadow: 0 12px 32px rgba(15, 23, 42, .12);
}
.slide-image img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
/* Capture claire ou sombre selon le thème affiché (la capture masquée, en loading="lazy", n'est pas téléchargée) */
:root:not([data-theme="dark"]) .slide-img-sombre,
:root[data-theme="dark"] .slide-img-clair:not(.is-repli) { display: none; }
.slider-controls {
    position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--border);
}
.slider-controls[hidden] { display: none; }
.slider-btn {
    width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    background: var(--surface); color: var(--text-2); border: 1px solid var(--border-strong); border-radius: 999px;
}
.slider-btn:hover { border-color: var(--primary); color: var(--primary); }
.slider-btn:focus-visible, .slider-dot:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.slider-pause { margin-left: 6px; }
.slider-dots { display: flex; align-items: center; gap: 2px; }
/* Zone de clic de 28 px autour d'un point de 10 px */
.slider-dot { width: 28px; height: 28px; padding: 0; background: none; border: 0; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.slider-dot::before { content: ""; width: 10px; height: 10px; border-radius: 999px; background: var(--border-strong); transition: width .2s, background-color .2s; }
.slider-dot[aria-current="true"]::before { width: 22px; background: var(--primary); }
/* Écran large : texte à gauche, capture à droite */
@media (min-width: 1001px) {
    .slider { min-height: 480px; }
    .slide { flex-direction: row; align-items: stretch; gap: 48px; padding: 0 0 0 56px; }
    .slide-text { flex: 0 0 34%; align-self: center; padding: 40px 0 96px; }
    .slide-title { font-size: clamp(32px, 3vw, 46px); }
    .slide-text p { font-size: 18px; }
    .slide-image { margin: 40px 0 56px; border-right: 0; border-radius: 12px 0 0 12px; }
}
@media (max-width: 640px) {
    .slider { min-height: 440px; }
    .slide { padding: 22px 18px 0; }
}

/* Bloc de connexion / création de compte */
.home-auth { align-self: start; width: 100%; scroll-margin-top: 90px; }
.home-auth-tabs { margin: -8px 0 18px; }
.home-auth-tabs .tab { flex: 1; text-align: center; justify-content: center; }
.home-auth .alert { margin-bottom: 14px; }
.home-auth-submit { width: 100%; margin-top: 24px; }
.home-auth .form-grid + .field { margin-top: 16px; }
.home-auth [hidden] { display: none; }

/* Bloc de connexion et chiffres clés côte à côte (l'un sous l'autre sur écran étroit) */
.home-duo { display: flex; flex-direction: column; gap: 24px; }
/* Bloc de connexion sur toute la largeur : les formulaires gardent une largeur de lecture confortable, centrés */
.home-duo .home-auth { align-self: stretch; }
.home-auth > :not(.home-block-title) { max-width: 560px; margin-left: auto; margin-right: auto; }
.home-auth > .home-auth-tabs, .home-auth > .home-auth-panels, .home-auth > .notice { width: 100%; }

/* Chiffres clés (compteurs animés par public/accueil.js) */
.home-stats { display: flex; flex-direction: column; background: linear-gradient(140deg, var(--primary-50), var(--surface) 70%); }
.home-auth .home-block-title + .home-auth-tabs { margin-top: 8px; }
.home-stats .card-intro { text-align: center; }
/* Les deux panneaux occupent la même case : le bloc garde la hauteur du plus grand quand on change d'onglet */
.home-auth-panels { display: grid; }
.home-auth-panels > [data-auth-panel] { grid-area: 1 / 1; }
/* Bloc pleine largeur : le panneau masqué ne réserve plus sa hauteur (le bloc suit le formulaire affiché) */
.home-auth .home-auth-panels > [hidden] { display: none; }
.home-block-title { text-align: center !important; margin: 0 0 4px; font-size: clamp(22px, 2vw, 26px); font-weight: 700; letter-spacing: -0.01em; color: var(--text); text-align: left; }
/* Les trois chiffres sur une seule ligne (l'un sous l'autre sur écran étroit) */
.home-stats-list { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; }
.home-stat { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 18px 12px; }
.home-stat + .home-stat { border-left: 1px solid var(--border); }
@media (max-width: 760px) {
    .home-stats-list { grid-template-columns: 1fr; }
    .home-stat { justify-content: flex-start; }
    .home-stat + .home-stat { border-left: 0; border-top: 1px solid var(--border); }
}
.home-stat .feature-icon { width: 56px; height: 56px; flex-shrink: 0; border-radius: 14px; }
.home-stat-text { display: flex; flex-direction: column; min-width: 0; }
.home-stat-value {
    font-size: clamp(36px, 4vw, 52px); line-height: 1.05; font-weight: 700; letter-spacing: -0.03em;
    color: var(--primary); font-variant-numeric: tabular-nums;
}
.home-stat-label { font-size: 16px; color: var(--text-3); }

/* Présentation */
.home-section-title { margin: 0 0 24px; font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; letter-spacing: -0.01em; color: var(--text); text-align: center; text-wrap: balance; }
/* Une ligne par bloc : texte d'un côté, vidéo de démonstration de l'autre, en alternance */
.feature-rows { display: flex; flex-direction: column; gap: 24px; }
.feature-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center; }
.feature-row:nth-child(even) .feature-row-text { order: 2; }
.feature-row-text h3 { margin: 16px 0 10px; font-size: clamp(22px, 2.2vw, 28px); font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.feature-row-text p { margin: 0; font-size: 17px; line-height: 1.6; color: var(--text-3); }
.feature-media { position: relative; aspect-ratio: 16 / 9; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.feature-video { display: block; width: 100%; height: 100%; object-fit: cover; }
:root:not([data-theme="dark"]) .feature-video-sombre,
:root[data-theme="dark"] .feature-video-clair { display: none; }
/* Une variante absente est remplacée par l'autre ; les deux absentes : « Vidéo à venir » */
:root:not([data-theme="dark"]) .feature-media.manque-clair .feature-video-sombre,
:root[data-theme="dark"] .feature-media.manque-sombre .feature-video-clair { display: block; }
.feature-media-vide { display: none; position: absolute; inset: 0; margin: 0; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; }
.feature-media.manque-clair.manque-sombre .feature-media-vide { display: flex; }
.feature-media.manque-clair.manque-sombre .feature-video, .feature-media.manque-clair.manque-sombre .feature-video-btn { display: none !important; }
.feature-video-btn { position: absolute; right: 10px; bottom: 10px; opacity: .85; }
@media (max-width: 900px) {
    .feature-row { grid-template-columns: 1fr; gap: 20px; }
    .feature-row:nth-child(even) .feature-row-text { order: 0; }
}
.feature h3 { margin: 16px 0 8px; font-size: 18px; font-weight: 700; color: var(--text); }
.feature p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text-3); }
.feature-icon {
    width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px; background: var(--primary-50); color: var(--primary);
}
.home-cta { margin-top: 32px; display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.home-cta p { margin: 0; font-size: 17px; font-weight: 600; color: var(--text); }

/* Pages « Bientôt disponible » */
.soon-card { width: 100%; max-width: 520px; text-align: center; }
.soon-badge {
    display: inline-block; margin: 4px 0 12px; padding: 4px 12px; border-radius: 999px;
    background: var(--primary-50); color: var(--primary-900); font-size: 14px; font-weight: 600;
}
.soon-card .btn { margin-top: 12px; }

/* Pied de page, sur toutes les pages : toujours en bas de l'écran, même quand le contenu est court.
   Le conteneur de la page (en-tête, contenu, pied de page) occupe au moins toute la hauteur
   de la fenêtre, et le contenu prend la place restante. */
body > .min-h-full { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body > .min-h-full > .page { flex: 1 0 auto; width: 100%; box-sizing: border-box; }
.app-footer { flex-shrink: 0; margin-top: 32px; background: var(--surface); border-top: 1px solid var(--border); }
.app-footer-inner {
    max-width: 1600px; margin: 0 auto; padding: 24px clamp(16px, 3vw, 40px);
    display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap;
}
.app-footer-brand { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--muted); }
.app-footer-brand strong { font-size: 16px; color: var(--text); }
.app-footer-links { display: flex; gap: 4px 20px; flex-wrap: wrap; }
.app-footer-links a { font-size: 14px; font-weight: 500; color: var(--text-2); padding: 6px 0; }
.app-footer-links a:hover { color: var(--primary); }
.app-footer-copy { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- Chronologie (carte « Timeline », vue livewire/timeline) ---------- */
:root {
    --tl-naissance: #15803D; --tl-naissance-bg: #F0FDF4;
    --tl-mariage: #2563EB;   --tl-mariage-bg: #EFF4FF;
    --tl-divorce: #B45309;   --tl-divorce-bg: #FFFBEB;
    --tl-deces: #475569;     --tl-deces-bg: #F1F5F9;
}
:root[data-theme="dark"] {
    --tl-naissance: #86EFAC; --tl-naissance-bg: #0F2E1D;
    --tl-mariage: #93C5FD;   --tl-mariage-bg: #1B2A4A;
    --tl-divorce: #FCD34D;   --tl-divorce-bg: #3A2A0A;
    --tl-deces: #CBD5E1;     --tl-deces-bg: #22304A;
}
.timeline-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.timeline-filter {
    display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
    font-size: 14px; font-weight: 500; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong);
}
.timeline-filter.is-on { color: var(--text); border-style: solid; background: var(--surface-2); }
.timeline-filter:focus-visible { outline: 3px solid var(--primary-200); outline-offset: 2px; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.timeline-filter-naissance.is-on .timeline-dot { background: var(--tl-naissance); }
.timeline-filter-mariage.is-on .timeline-dot { background: var(--tl-mariage); }
.timeline-filter-divorce.is-on .timeline-dot { background: var(--tl-divorce); }
.timeline-filter-deces.is-on .timeline-dot { background: var(--tl-deces); }

.timeline-decades {
    display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 0 14px; margin-bottom: 8px; border-bottom: 1px solid var(--border);
}
.timeline-decade-link {
    padding: 4px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-2);
    background: transparent; border: 1px solid transparent; cursor: pointer;
}
.timeline-decade-link:hover, .timeline-decade-link:focus-visible { color: var(--primary); border-color: var(--border); background: var(--surface-2); }

.timeline-decade { scroll-margin-top: 90px; }
.timeline-decade-title {
    display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
    margin: 24px 0 8px; font-size: 20px; font-weight: 700; color: var(--text);
}
.timeline-decade-count { font-size: 13px; font-weight: 500; color: var(--muted); }

.timeline-list { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline-item { position: relative; display: flex; gap: 14px; padding: 0 0 18px; }
/* Ligne verticale qui relie les événements */
.timeline-item::before {
    content: ""; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-marker {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    position: relative; z-index: 1;
}
.timeline-marker svg { width: 18px; height: 18px; }
.timeline-naissance .timeline-marker { color: var(--tl-naissance); background: var(--tl-naissance-bg); }
.timeline-mariage .timeline-marker { color: var(--tl-mariage); background: var(--tl-mariage-bg); }
.timeline-divorce .timeline-marker { color: var(--tl-divorce); background: var(--tl-divorce-bg); }
.timeline-deces .timeline-marker { color: var(--tl-deces); background: var(--tl-deces-bg); }

.timeline-body { min-width: 0; flex: 1; padding-top: 2px; }
.timeline-date { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.timeline-row { display: flex; align-items: center; gap: 10px; }
.timeline-avatars { display: inline-flex; flex-shrink: 0; }
.timeline-avatars .avatar { width: 32px; height: 32px; font-size: 12px; border: 2px solid var(--surface); }
.timeline-avatars .avatar + .avatar { margin-left: -10px; }
.timeline-text { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-2); overflow-wrap: anywhere; }
.timeline-text a { color: var(--text); font-weight: 600; }
.timeline-text a:hover { color: var(--primary); text-decoration: underline; }
.timeline-person-off { color: var(--text); font-weight: 600; }
.timeline-detail { margin-left: 4px; color: var(--muted); font-size: 14px; }

.timeline-missing { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.link-button {
    padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-weight: 600; color: var(--primary);
}
.link-button:hover { text-decoration: underline; }
@media (max-width: 560px) {
    .timeline-row { align-items: flex-start; }
    .timeline-avatars { display: none; }
}

/* ---------- Import / export CSV des membres (vue livewire/families/members-import) ---------- */
.csv-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.csv-actions .btn svg { width: 18px; height: 18px; }
.csv-help { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.csv-help > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; color: var(--text); }
.csv-help > summary:focus-visible { outline: 3px solid var(--primary-200); outline-offset: 2px; border-radius: var(--radius-sm); }
.csv-help ul { margin: 0; padding: 0 16px 12px 36px; color: var(--text-2); font-size: 14px; line-height: 1.6; }
.csv-help .table-wrap { padding: 0 16px 16px; }
.csv-columns { font-size: 14px; background: var(--surface); }
.csv-columns code { font-size: 13px; color: var(--text); }

.csv-report { margin-top: 20px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.csv-report-title { margin: 0 0 8px; font-size: 17px; font-weight: 700; color: var(--text); }
.csv-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.csv-counts div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.csv-counts dt { font-size: 13px; color: var(--muted); }
.csv-counts dd { margin: 2px 0 0; font-size: 22px; font-weight: 700; color: var(--text); }
.csv-list-title { margin: 14px 0 6px; font-size: 14px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.csv-list-erreur { color: var(--danger); cursor: default; }
.csv-messages { margin: 0; padding-left: 20px; max-height: 260px; overflow-y: auto; font-size: 14px; line-height: 1.6; color: var(--text-2); overflow-wrap: anywhere; }

/* ---------- Familles d'un membre (vue livewire/members/member-families) ---------- */
.member-families { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.member-family { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; }
.member-family + .member-family { border-top: 1px solid var(--border); }
.member-family-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.member-family-name { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
a.member-family-name:hover { color: var(--primary); }
.member-family-name.is-off { color: var(--muted); }
.member-family-role, .member-family-hint { font-size: 13px; color: var(--muted); }
.member-family-hint { max-width: 320px; }
.member-family-add { max-width: 420px; }
.member-family-preview { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.member-family-list > summary { cursor: pointer; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--primary); }
.member-family-list ul { margin: 6px 0 0; padding-left: 20px; max-height: 220px; overflow-y: auto; font-size: 14px; line-height: 1.6; }

/* ---------- Recherche : bouton « Voir tous les résultats » et page des résultats (entities/search/index) ---------- */
.header-search-all { margin-top: 12px; }
.search-page-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; max-width: 640px; }
.search-page-form .search { flex: 1 1 260px; }
.search-results-section { margin-bottom: 24px; scroll-margin-top: 90px; }
.search-results-families { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.search-results-families .search-family-card + .search-family-card { margin-top: 0; }
.search-results-families .search-family-card:hover { border-color: var(--primary); }

/* ---------- Champ mot de passe avec bouton « Afficher / Masquer » (composant x-password-field, public/password.js) ---------- */
.password-field { position: relative; }
.password-field .form-input { padding-right: 48px; }
.password-field input::-ms-reveal, .password-field input::-ms-clear { display: none; } /* œil natif d'Edge : remplacé par le nôtre */
.password-toggle {
    display: none; position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
    width: 36px; height: 36px; align-items: center; justify-content: center;
    border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.password-js .password-toggle { display: inline-flex; }
.password-toggle:hover { color: var(--text); background: var(--surface-2); }
.password-toggle:focus-visible { outline: 3px solid var(--primary-200); outline-offset: 0; color: var(--text); }
.password-toggle svg { width: 20px; height: 20px; }
.password-toggle .password-toggle-hide { display: none; }
.password-toggle[aria-pressed="true"] .password-toggle-show { display: none; }
.password-toggle[aria-pressed="true"] .password-toggle-hide { display: block; }

/* ---------- Ajout d'un membre : choix face à un homonyme (entities/members/create) ---------- */
.homonymes { border-color: var(--primary-200); scroll-margin-top: 90px; }
.homonymes-choix { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.homonyme-choix {
    display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; cursor: pointer;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2);
}
.homonyme-choix:hover { border-color: var(--primary); }
.homonyme-choix:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.homonyme-choix input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }
.homonyme-choix strong { color: var(--text); }
.homonyme-choix.is-off { cursor: default; opacity: .6; }

/* Ajouter un membre : recherche des parents, du conjoint et des enfants (vue entities/members/create) */
.picker-choisis { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.picker-choisis:empty { display: none; }
.picker-choisi { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 14px; border: 1px solid var(--primary); border-radius: 10px; background: var(--primary-50); }
.picker-choisi strong { color: var(--text); }
.picker-role { display: inline-block; min-width: 42px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.picker-resultats { list-style: none; margin: 8px 0 0; padding: 4px; max-height: 300px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.picker-resultats[hidden] { display: none; }
.picker-resultat { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: none; color: var(--text-2); text-align: left; cursor: pointer; font: inherit; }
.picker-resultat:hover:not([disabled]), .picker-resultat:focus-visible { background: var(--surface-2); color: var(--text); }
.picker-resultat strong { color: var(--text); font-weight: 600; }
.picker-resultat[disabled] { cursor: default; opacity: .55; }
.picker-note { font-size: 13px; color: var(--muted); }
.picker-vide { padding: 9px 12px; font-size: 14px; color: var(--muted); }

/* ---------- Message de confirmation (composant Toast, monté dans layouts/app) ---------- */
.toast-zone { position: fixed; right: 16px; bottom: 16px; left: 16px; z-index: 60; display: flex; justify-content: flex-end; pointer-events: none; }
.toast {
    pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; max-width: 420px; width: 100%;
    padding: 14px 14px 14px 16px; border-radius: var(--radius-sm); border: 1px solid;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .18); animation: toast-entree .25s ease-out;
}
.toast-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.toast-danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.toast > svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px; }
.toast-text { flex: 1; margin: 0; font-size: 15px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
.toast-close { flex-shrink: 0; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
.toast-close:hover { background: rgba(127, 127, 127, .15); }
.toast-close:focus-visible { outline: 3px solid var(--primary-200); }
.toast-close svg { width: 16px; height: 16px; }
@keyframes toast-entree { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* Espacement des éléments de liste (repris de l'ancien public/style.css, supprimé) */
.timeline-item, .member-family, .settings-family, .home-stat, .csv-help li, .csv-messages li { margin: 3px 0; }

/* Carte #52 : branches non reliées, ascendants, roue en plein écran */
.tc-separation { stroke: var(--border-strong); stroke-width: 1.5; stroke-dasharray: 6 6; }
.tc-groupe-titre { font-size: 13px; font-weight: 600; fill: var(--muted); }
.tree-hint-groupes { color: var(--text-3); }

.vue-choix { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.vue-choix-btn { border: 0; background: transparent; color: var(--text-3); font: inherit; font-size: 14px; padding: 6px 14px; border-radius: 7px; cursor: pointer; }
.vue-choix-btn:hover { color: var(--text); }
.vue-choix-btn[aria-pressed="true"] { background: var(--primary-solid); color: #fff; font-weight: 600; }
.vue-choix-btn:focus-visible { outline: 3px solid var(--primary-200); outline-offset: 1px; }

.wheel-chart { display: flex; flex-direction: column; }
.wheel-stats { font-size: 14px; color: var(--text-3); }
.wheel-tools { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.wheel-chart-compacte .wheel-tools { margin-left: auto; }
.wheel-svg { display: block; width: 100%; height: 74vh; min-height: 420px; max-height: 760px; }
.wheel-chart-compacte .wheel-svg { height: 340px; min-height: 0; }
.wheel-titre { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--text); }
.wheel-chart.is-fullscreen { position: fixed; inset: 0; z-index: 9998; background: var(--bg); padding: 16px; }
.wheel-chart.is-fullscreen .wheel-svg { flex: 1; height: auto; min-height: 0; max-height: none; }

.wheels-layout { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.wheels-main { flex: 3 1 520px; min-width: 0; }
.wheels-side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.wheels-side .tree-hint { margin: 0; }
.wheels-side .wheel-chart { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface-2); }
.wheels-side .wheel-chart.is-fullscreen { border: 0; border-radius: 0; background: var(--bg); }

/* Compte rendu de l'import CSV : membres créés, mis à jour, en doublon, lignes ignorées */
.csv-section { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); border-left: 4px solid var(--border-strong); }
.csv-section-title { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: var(--text); }
.csv-section-vide { margin: 0; font-size: 14px; color: var(--muted); }
.csv-section-mention { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.csv-section-cree { border-left-color: var(--success, #16A34A); }
.csv-section-maj { border-left-color: var(--primary); }
.csv-section-doublon { border-left-color: var(--muted); }
.csv-section-ignoree { border-left-color: var(--danger); }

/* ---------- Étoile du doyen d'une famille (vue livewire/partials/doyen-star, carte #70) ---------- */
.doyen-star { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.doyen-star svg { width: 18px; height: 18px; }
.doyen-star:hover, .doyen-star:focus-visible { color: #D97706; background: var(--surface-2); }
.doyen-star.is-doyen { color: #F59E0B; }
.doyen-star.is-static { cursor: default; }
.doyen-star[disabled] { opacity: .5; }
.member-cell { display: flex; align-items: center; gap: 6px; }
.member-card-wrap { position: relative; }
.member-card-wrap > .doyen-star { position: absolute; top: 6px; right: 6px; z-index: 1; }
.member-family .doyen-star { margin-right: 4px; }
.tree-doyen strong { color: var(--text); }
/* Bouton « Définir comme doyen » de la fiche et de la page « Modifier » (vue livewire/members/doyen-action) */
.doyen-action { display: contents; }
.doyen-action-star { display: inline-flex; color: var(--muted); }
.doyen-action-star svg { width: 18px; height: 18px; }
.doyen-action-star.is-doyen { color: #F59E0B; }
.doyen-menu { position: relative; }
.doyen-menu > summary { list-style: none; }
.doyen-menu > summary::-webkit-details-marker { display: none; }
.doyen-menu .dropdown { left: 0; right: auto; min-width: 240px; }
.page-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* En-tête de la page « Modifier » d'un membre : photo cliquable (choix d'une photo), nom qui ramène à la fiche */
.profile-avatar-btn { position: relative; flex: none; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.profile-avatar-btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.profile-avatar-edit { position: absolute; right: 2px; bottom: 2px; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; border: 3px solid var(--surface); }
.profile-avatar-edit svg { width: 16px; height: 16px; }
.profile-avatar-btn:hover .avatar { filter: brightness(1.1); }
.profile-name-link { color: inherit; }
.profile-name-link:hover { color: var(--primary); }

/* ---------- Bandeau de la famille sur la fiche d'un membre (vue livewire/members/members-show) ---------- */
.family-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 16px; padding: 14px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius, 16px); }
.family-band-name { font-size: 26px; font-weight: 800; line-height: 1.2; color: var(--text); overflow-wrap: anywhere; }
.family-band-name:hover { color: var(--primary); }
.family-band-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.family-band-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.family-band-main .family-creator { margin: 0; flex-wrap: wrap; }
.family-band-icon svg { width: 20px; height: 20px; }

/* ---------- Historique des imports CSV (vue livewire/families/import-history, carte #69) ---------- */
.import-history td { vertical-align: top; white-space: normal; }
.import-history tr.is-selected td { background: var(--surface-2); }
.import-history-detail { margin-top: 6px; font-size: 14px; }
.import-history-detail summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.import-history .btn-sm { display: flex; margin-top: 8px; }

/* ---------- Tutoriel animé (public/tutoriel.js, Driver.js) : bulle aux couleurs du site, clair et sombre ---------- */
.profile-actions-groupe { display: inline-flex; flex-wrap: wrap; gap: 10px; }
.driver-popover.tuto-bulle {
    max-width: 340px; padding: 18px 20px 16px; border: 1px solid var(--border); border-radius: 14px;
    background: var(--surface); color: var(--text); font-family: inherit;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .28);
}
.tuto-bulle .driver-popover-title { font-size: 17px; font-weight: 700; color: var(--text); }
.tuto-bulle .driver-popover-description { margin-top: 6px; font-size: 15px; line-height: 1.55; color: var(--text-2); }
.tuto-bulle .driver-popover-footer { margin-top: 16px; gap: 8px; flex-wrap: wrap; }
.tuto-bulle .driver-popover-progress-text { font-size: 13px; font-weight: 600; color: var(--muted); }
.tuto-bulle .driver-popover-navigation-btns { gap: 6px; }
.tuto-bulle .driver-popover-footer button {
    padding: 7px 14px; border-radius: var(--radius-sm); font: inherit; font-size: 14px; font-weight: 600; text-shadow: none;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
}
.tuto-bulle .driver-popover-footer .driver-popover-next-btn { background: var(--primary); border-color: var(--primary); color: #fff; }
.tuto-bulle .driver-popover-footer .driver-popover-next-btn:hover { background: var(--primary-hover); }
.tuto-bulle .driver-popover-footer .driver-popover-prev-btn:hover { background: var(--surface-2); color: var(--text); }
.tuto-bulle .driver-popover-footer .driver-popover-btn-disabled { opacity: .45; }
.tuto-bulle .driver-popover-footer .tuto-ignorer {
    order: 3; flex-basis: 100%; margin-top: 4px; padding: 4px 0; border: 0; background: none;
    color: var(--muted); font-weight: 500; text-align: left; text-decoration: underline; cursor: pointer;
}
.tuto-bulle .driver-popover-footer .tuto-ignorer:hover { color: var(--text); background: none; }
.tuto-bulle button:focus-visible { outline: 3px solid var(--primary-200); outline-offset: 1px; }
/* Flèche de la bulle : la pointe prend la couleur de la bulle (les autres côtés restent transparents) */
.tuto-bulle .driver-popover-arrow-side-left { border-left-color: var(--surface); }
.tuto-bulle .driver-popover-arrow-side-right { border-right-color: var(--surface); }
.tuto-bulle .driver-popover-arrow-side-top { border-top-color: var(--surface); }
.tuto-bulle .driver-popover-arrow-side-bottom { border-bottom-color: var(--surface); }
/* Bouton « ? » du tutoriel : dans le coin en haut à droite du bloc du membre */
.profile[data-tuto] { position: relative; }
.profile .tuto-relancer { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; min-height: 0; color: var(--muted); }
.profile .tuto-relancer:hover { color: var(--primary); background: var(--surface-2); }
.profile .tuto-relancer svg { width: 20px; height: 20px; }
/* Les boutons d'action de l'en-tête passent sous le « ? » pour ne pas se chevaucher */
.profile:has(> .tuto-relancer) > .profile-actions { margin-top: 22px; }
/* Tutoriel : léger flou du reste du site sous le voile (zone éclairée exclue par clip-path, voir public/tutoriel.js) */
.driver-overlay.tuto-flou { -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
/* Driver.js met un fond #f7f7f7 au bouton qui a le focus (souvent « Précédent » en changeant d'étape) : on garde nos couleurs */
.driver-popover.tuto-bulle .driver-popover-footer .driver-popover-prev-btn:focus { background: var(--surface); color: var(--text-2); }
.driver-popover.tuto-bulle .driver-popover-footer .driver-popover-prev-btn:hover { background: var(--surface-2); color: var(--text); }
.driver-popover.tuto-bulle .driver-popover-footer .driver-popover-next-btn:focus { background: var(--primary); color: #fff; }
.driver-popover.tuto-bulle .driver-popover-footer .driver-popover-next-btn:hover { background: var(--primary-hover); }
.driver-popover.tuto-bulle .driver-popover-footer .tuto-ignorer:focus,
.driver-popover.tuto-bulle .driver-popover-footer .tuto-ignorer:hover { background: none; }

/* ---------- Notifications de famille (carte #72) ---------- */
/* Pastille rouge en haut à gauche des initiales du compte (et du bouton ☰ sur petit écran) */
.user-btn, .menu-toggle { position: relative; }
.notif-pastille {
    position: absolute; top: -6px; left: -6px; min-width: 20px; height: 20px; padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; border: 2px solid var(--surface); background: #DC2626; color: #fff;
    font-size: 11px; font-weight: 700; line-height: 1; pointer-events: none;
}
.notif-pastille[hidden], .notif-compteur[hidden] { display: none; }
/* Compteur dans le menu du compte et dans le menu de Réglages */
.notif-compteur {
    margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; background: #DC2626; color: #fff; font-size: 12px; font-weight: 700;
}
/* Réglages > Notifications : liste */
.notif-entete { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.notif-liste { list-style: none; margin: 8px 0 16px; padding: 0; }
.notif + .notif { border-top: 1px solid var(--border-soft); }
.notif-lien { display: flex; align-items: flex-start; gap: 14px; padding: 14px 12px; border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none; }
a.notif-lien:hover { background: var(--surface-2); color: var(--text); }
.notif-lien.is-off { color: var(--muted); }
.notif-lien:focus-visible { outline: 3px solid var(--primary-200); outline-offset: 1px; }
.notif.is-unread .notif-lien { background: var(--primary-50); color: var(--text); }
.notif.is-unread a.notif-lien:hover { background: var(--primary-100); }
.notif-icone { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); color: var(--primary); }
.notif-icone svg { width: 19px; height: 19px; }
.notif-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.notif-texte { font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.notif-texte strong { color: var(--text); font-weight: 600; }
.notif-lien.is-off .notif-texte strong { color: var(--muted); }
.notif-quand { font-size: 13px; color: var(--muted); }
.notif-point { flex: none; width: 10px; height: 10px; margin-top: 8px; border-radius: 50%; background: var(--primary); }
/* Réglages > Gestion des notifications */
.notif-types { display: flex; flex-direction: column; gap: 2px; border: 0; padding: 0; margin: 8px 0 12px; min-width: 0; }

/* Menu de gauche de « Créer une famille » : rubriques grisées, disponibles après la création */
.rubriques-item-off, .rubriques-item-off:hover { opacity: .5; cursor: not-allowed; background: none; color: var(--text-3); }

/* En-têtes de tableau triables (liste des membres) */
.data-table th .sort-link { color: inherit; display: inline-flex; gap: 6px; align-items: center; }
.data-table th .sort-link:hover { color: var(--primary); }
.data-table th[aria-sort="ascending"], .data-table th[aria-sort="descending"] { color: var(--text); }
.toolbar select.form-input { width: auto; min-width: 150px; }
/* Ligne de filtres sous les en-têtes : un filtre au-dessus de sa colonne */
.data-table .filter-row td { background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 8px 16px; vertical-align: top; }
.data-table .filter-row select.form-input, .data-table .filter-row .search .form-input { width: 100%; min-width: 140px; min-height: 36px; font-size: 14px; text-transform: none; }
.data-table .filter-row .filter-stack { display: flex; flex-direction: column; gap: 8px; }
.table-footer select.form-input { width: auto; min-height: 32px; font-size: 13px; }
.data-table th button.sort-link { background: none; border: 0; padding: 0; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.data-table tbody.is-loading { opacity: .55; transition: opacity .15s; }
.data-table th button.sort-link { background: none; border: 0; padding: 0; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.data-table tbody.is-loading { opacity: .55; transition: opacity .15s; }

/* Règles d'un mot de passe : grises, puis vertes quand elles sont respectées (<x-password-rules>) */
.password-rules { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.password-rules li { display: flex; align-items: center; gap: 8px; }
.password-rule-icon {
    width: 16px; height: 16px; flex: 0 0 16px; border-radius: 50%; border: 1.5px solid currentColor; position: relative; opacity: .7;
}
.password-rules li.is-ok { color: var(--success, #15803d); }
.password-rules li.is-ok .password-rule-icon { background: currentColor; border-color: currentColor; opacity: 1; }
.password-rules li.is-ok .password-rule-icon::after {
    content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.password-rules li.is-ko { color: var(--danger); }
.password-rules li.password-rules-aide { color: var(--muted); font-style: italic; }
.btn[disabled], .btn:disabled { opacity: .5; cursor: not-allowed; }
/* Bouton « Générer un mot de passe » : seulement si JavaScript tourne (classe password-js sur <html>, public/password.js) */
.password-rules .password-rules-generer { display: none; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.password-js .password-rules .password-rules-generer { display: flex; }
.password-rules-generer [data-password-message] { font-size: 13px; color: var(--success); }

/* Message qui reste affiché dans un bloc (contrairement à .alert, flottant et effacé après 6 s) */
.notice { padding: 12px 14px; border-radius: 12px; border: 1px solid; font-size: 14px; line-height: 1.5; margin: 0 0 14px; }
.notice-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.notice-danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.notice strong { font-weight: 600; }

/* Pastilles d'état (ex. validation de l'e-mail dans la liste des utilisateurs) */
.chip-success, .chip-success:hover { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.chip-warning, .chip-warning:hover { background: #FFFBEB; color: #B45309; border: 1px solid #FCD34D; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip-warning { background: #3A2A0A; color: #FBBF24; border-color: #78561A; } }
:root[data-theme="dark"] .chip-warning, :root[data-theme="dark"] .chip-warning:hover { background: #3A2A0A; color: #FBBF24; border-color: #78561A; }
@keyframes ft-spin { to { transform: rotate(360deg); } }
.spin { animation: ft-spin .8s linear infinite; }
.fusion-conflit th, .fusion-conflit td { background: var(--primary-50); }
