/* ==========================================================================
   JM Menétrey · application de gestion (thème clair, bleu pétrole / flamme / eau)
   ========================================================================== */
:root {
    --bleu: #0b3d5c; --bleu-2: #155e82; --bleu-3: #2a7fa8; --bleu-pale: #e2eef6; --bleu-ghost: #f0f6fa;
    --flamme: #ee8a2a; --flamme-fonce: #c96a0f; --flamme-pale: #fdebd9;
    --eau: #1aa6b7; --eau-fonce: #12727e; --eau-pale: #ddf4f6;
    --vert: #2f855a; --vert-fonce: #246747; --vert-pale: #e2f5ea;
    --rouge: #c53d3d; --rouge-fonce: #8f2b2b; --rouge-pale: #fbe5e5;
    --ambre: #8a5a00; --ambre-pale: #fff3d6;
    --encre: #1c2830; --encre-2: #4a5964; --encre-3: #7a8893; --ligne: #dbe4ea; --papier: #f3f6f8; --blanc: #fff;
    --font-display: 'Outfit', 'Nunito', 'Segoe UI', sans-serif; --font-body: 'Nunito', 'Segoe UI', Helvetica, Arial, sans-serif;
    --radius: 16px; --shadow: 0 12px 30px -20px rgba(11, 61, 92, .5);
    --bs-body-font-family: var(--font-body); --bs-body-color: var(--encre); --bs-body-bg: var(--papier);
    --bs-link-color: var(--bleu-2); --bs-link-color-rgb: 21, 94, 130; --bs-link-hover-color: var(--flamme-fonce); --bs-link-hover-color-rgb: 201, 106, 15;
    --bs-border-color: var(--ligne); --bs-primary: var(--bleu-2); --bs-primary-rgb: 21, 94, 130;
    /* Palette des avatars et des profils (classes avatar-N / swatch-N) */
    --c1: #0b3d5c; --c2: #1aa6b7; --c3: #ee8a2a; --c4: #2f855a; --c5: #6f5bb5; --c6: #c53d3d; --c7: #b7791f; --c8: #4c6a83;
}
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-body); background: var(--papier); color: var(--encre); font-size: 1rem; line-height: 1.55; -webkit-font-smoothing: antialiased; min-height: 100vh; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--bleu); line-height: 1.12; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin: .1rem 0 .4rem; }
h2 { font-size: 1.25rem; margin: 0; }
h3 { font-size: 1.05rem; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--flamme); outline-offset: 2px; }
.icon { width: 22px; height: 22px; flex: 0 0 auto; vertical-align: -5px; }
.icon-xs { width: 16px; height: 16px; vertical-align: -3px; }
.small { font-size: .875rem; }
.text-muted { color: var(--encre-3) !important; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 100; }

/* ---- Bandeau d'environnement et impersonation ---- */
.stage-ribbon { background: repeating-linear-gradient(135deg, var(--flamme) 0 14px, var(--flamme-fonce) 14px 28px); color: #fff; text-align: center; font-weight: 800; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; padding: .25rem; }
.impersonation { background: var(--ambre-pale); color: var(--ambre); text-align: center; padding: .45rem 1rem; font-size: .92rem; }
.impersonation a { color: var(--ambre); font-weight: 700; text-decoration: underline; }

/* ---- Barre du haut ---- */
.topbar { background: linear-gradient(100deg, var(--bleu), var(--bleu-2)); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 6px 20px -14px rgba(11, 61, 92, .8); }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: .55rem 1.25rem; display: flex; align-items: center; gap: 1.25rem; }
.brand { display: flex; align-items: center; gap: .65rem; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; color: #fff; }
.brand-mark { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .5); }
.brand-lg .brand-mark { width: 56px; height: 56px; border-radius: 15px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.brand-text small { font-size: .72rem; color: var(--eau-pale); letter-spacing: .06em; text-transform: uppercase; }
.topnav { display: flex; gap: .15rem; flex-wrap: wrap; }
.topnav a { color: rgba(255, 255, 255, .85); text-decoration: none; font-weight: 700; padding: .5rem .9rem; border-radius: 999px; font-size: .95rem; display: inline-flex; align-items: center; gap: .45rem; transition: background .15s ease; }
.topnav a:hover { color: #fff; background: rgba(255, 255, 255, .12); text-decoration: none; }
.topnav a.active { background: var(--flamme); color: #fff; }
.topnav .icon { width: 20px; height: 20px; }
.topbar-user { margin-left: auto; }
.user-button { display: inline-flex; align-items: center; gap: .5rem; background: rgba(255, 255, 255, .1); border: 0; color: #fff; border-radius: 999px; padding: .3rem .8rem .3rem .3rem; font-weight: 700; font-family: inherit; }
.user-button:hover { background: rgba(255, 255, 255, .18); }
.dropdown-menu { border: 1px solid var(--ligne); border-radius: 14px; box-shadow: var(--shadow); padding: .4rem; min-width: 220px; }
.dropdown-item { border-radius: 9px; padding: .5rem .8rem; font-weight: 600; }
.dropdown-item:hover { background: var(--bleu-ghost); color: var(--bleu); }
.dropdown-header { color: var(--bleu); font-weight: 700; padding: .5rem .8rem .3rem; }
.dropdown-header small { color: var(--encre-3); font-weight: 500; }

/* ---- Page ---- */
.main { max-width: 1280px; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head-person { align-items: center; }
.kicker { font-family: var(--font-display); color: var(--flamme-fonce); font-weight: 600; margin: 0; font-size: .95rem; letter-spacing: .02em; }
.eyebrow { font-family: var(--font-display); color: var(--eau-fonce); font-weight: 600; margin: 0 0 .3rem; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }
.lead-text { color: var(--encre-2); margin: 0; max-width: 60rem; font-size: 1.05rem; }
.breadcrumb-link { margin: 0 0 .6rem; }
.breadcrumb-link a { font-weight: 700; display: inline-flex; align-items: center; gap: .3rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.actions-wrap { margin-top: 1rem; }
.inline-form { display: inline; }
.stack { display: flex; flex-direction: column; gap: 1.1rem; }
.btn { border-radius: 999px; font-weight: 700; padding: .6rem 1.25rem; display: inline-flex; align-items: center; gap: .45rem; justify-content: center; font-family: inherit; }
.btn .icon { width: 18px; height: 18px; }
.btn-sm { padding: .35rem .85rem; font-size: .85rem; }
.btn-lg { padding: .85rem 1.6rem; font-size: 1.05rem; }
.btn-primary { background: var(--bleu-2); border-color: var(--bleu-2); color: #fff; }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.btn-secondary { background: #fff; border: 1px solid var(--bleu-2); color: var(--bleu-2); }
.btn-secondary:hover { background: var(--bleu-2); color: #fff; }
.btn-success { background: var(--vert); border-color: var(--vert); color: #fff; }
.btn-success:hover { background: var(--vert-fonce); border-color: var(--vert-fonce); }
.btn-outline-danger { border-color: var(--rouge); color: var(--rouge); background: #fff; }
.btn-outline-danger:hover { background: var(--rouge); color: #fff; border-color: var(--rouge); }
.btn-link { color: var(--encre-2); font-weight: 600; }
.alert { border-radius: 12px; border: 0; font-weight: 600; }
.alert-success { background: var(--vert-pale); color: var(--vert-fonce); }
.alert-info { background: var(--bleu-pale); color: var(--bleu); }
.alert-warning { background: var(--ambre-pale); color: var(--ambre); }
.alert-danger { background: var(--rouge-pale); color: var(--rouge-fonce); }
.empty { color: var(--encre-3); margin: 0; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--encre-2); }
.empty-state .empty-icon { width: 56px; height: 56px; color: var(--bleu-3); opacity: .6; margin-bottom: .6rem; }
.empty-state p { max-width: 34rem; margin: 0 auto .9rem; font-size: 1.05rem; }
.badge-soon { display: inline-block; background: var(--ambre-pale); color: var(--ambre); font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; border-radius: 999px; padding: .1rem .5rem; vertical-align: middle; font-style: normal; }

/* ---- Cartes et tuiles ---- */
.card { background: var(--blanc); border: 1px solid var(--ligne); border-radius: var(--radius); padding: 1.35rem 1.5rem; margin-bottom: 1.5rem; }
.card-table { padding: 0; overflow: hidden; }
.card-table .table { margin: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card-head a { font-weight: 700; }
.card-tip { background: var(--bleu-ghost); border-color: var(--bleu-pale); }
.card-welcome { text-align: center; }
.card-welcome .welcome-icon { width: 56px; height: 56px; color: var(--eau); margin-bottom: .5rem; }
.card-welcome h2 { margin-bottom: .4rem; }
.card-welcome p { color: var(--encre-2); max-width: 26rem; margin: 0 auto 1rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.tile { position: relative; display: block; background: var(--blanc); border: 1px solid var(--ligne); border-radius: var(--radius); padding: 1.2rem 1.3rem 1.1rem; color: var(--encre); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
a.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; color: var(--encre); }
.tile-icon { position: absolute; top: 1rem; right: 1rem; width: 30px; height: 30px; color: var(--eau); }
.tile strong { display: block; font-family: var(--font-display); font-size: 2.1rem; color: var(--bleu); line-height: 1.1; }
.tile span { display: block; color: var(--encre-2); margin-top: .2rem; font-weight: 600; }
.tile small { display: block; color: var(--encre-3); margin-top: .35rem; }

/* ---- Étapes de démarrage ---- */
.card-steps { background: linear-gradient(120deg, var(--bleu-ghost), #fff 70%); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.steps li { display: flex; gap: .9rem; align-items: flex-start; }
.step-mark { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--bleu-3); color: var(--bleu); font-family: var(--font-display); font-weight: 700; }
.steps li.is-done .step-mark { background: var(--vert); border-color: var(--vert); color: #fff; }
.steps li.is-done .step-body a { color: var(--encre-3); text-decoration: line-through; }
.step-body { display: flex; flex-direction: column; }
.step-body a { font-weight: 800; font-size: 1.02rem; }
.step-body small { color: var(--encre-2); }

/* ---- Post-its ---- */
.postits { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 320px)); gap: 1.1rem; margin: 0 0 1.75rem; padding: 0; list-style: none; }
.postit { position: relative; display: block; text-decoration: none; color: var(--encre); border-radius: 4px; padding: 1.1rem 1.2rem 1rem; box-shadow: 0 10px 22px -14px rgba(11, 61, 92, .55); transform: rotate(-1.2deg); transition: transform .2s ease, box-shadow .2s ease; min-height: 120px; background: var(--ambre-pale); }
.postit:hover { transform: rotate(0) translateY(-3px); box-shadow: 0 18px 30px -16px rgba(11, 61, 92, .6); color: var(--encre); text-decoration: none; }
.postit::before { content: ''; position: absolute; top: -9px; left: 50%; width: 54px; height: 16px; margin-left: -27px; background: rgba(255, 255, 255, .6); border: 1px solid rgba(11, 61, 92, .12); transform: rotate(-2deg); }
.postit--invited { background: var(--flamme-pale); }
.postit-count { display: block; font-family: var(--font-display); font-size: 2.3rem; line-height: 1; color: var(--bleu); }
.postit-label { display: block; font-weight: 800; margin-top: .25rem; }
.postit-hint { display: block; font-size: .85rem; color: var(--encre-2); margin-top: .35rem; line-height: 1.4; }

/* ---- Personnes, avatars, statuts ---- */
.avatar { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: .95rem; letter-spacing: .02em; flex: 0 0 auto; }
.avatar-sm { width: 32px; height: 32px; font-size: .78rem; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.6rem; }
.avatar-1, .swatch-1 { background: var(--c1); } .avatar-2, .swatch-2 { background: var(--c2); } .avatar-3, .swatch-3 { background: var(--c3); } .avatar-4, .swatch-4 { background: var(--c4); }
.avatar-5, .swatch-5 { background: var(--c5); } .avatar-6, .swatch-6 { background: var(--c6); } .avatar-7, .swatch-7 { background: var(--c7); } .avatar-8, .swatch-8 { background: var(--c8); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; flex: 0 0 auto; }
.swatch-lg { width: 22px; height: 22px; }
.swatch-border-1 { border-top-color: var(--c1); } .swatch-border-2 { border-top-color: var(--c2); } .swatch-border-3 { border-top-color: var(--c3); } .swatch-border-4 { border-top-color: var(--c4); }
.swatch-border-5 { border-top-color: var(--c5); } .swatch-border-6 { border-top-color: var(--c6); } .swatch-border-7 { border-top-color: var(--c7); } .swatch-border-8 { border-top-color: var(--c8); }
.with-avatar { display: flex; gap: .75rem; align-items: center; }
.with-avatar-lg { gap: 1.1rem; }
.person-name { display: block; font-weight: 800; font-size: 1.05rem; color: var(--bleu); }
.person-sub { display: block; font-size: .85rem; color: var(--encre-3); }
.people { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem; }
.person { display: flex; gap: .7rem; align-items: center; padding: .5rem .6rem; border-radius: 12px; color: var(--encre); text-decoration: none; }
a.person:hover { background: var(--bleu-ghost); text-decoration: none; color: var(--encre); }
.person-body { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.person-body strong { font-weight: 800; }
.person-body small { color: var(--encre-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { display: inline-flex; align-items: center; gap: .4rem; background: var(--bleu-ghost); border: 1px solid var(--bleu-pale); color: var(--bleu); border-radius: 999px; padding: .15rem .7rem .15rem .5rem; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.chip-muted { color: var(--encre-3); }
.status { display: inline-block; padding: .16rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 800; white-space: nowrap; vertical-align: middle; }
.status-active { background: var(--vert-pale); color: var(--vert-fonce); }
.status-invited { background: var(--flamme-pale); color: var(--flamme-fonce); }
.status-inactive, .status-left { background: var(--rouge-pale); color: var(--rouge-fonce); }

/* ---- Tableaux, filtres ---- */
.team-table { --bs-table-bg: transparent; margin-bottom: 0; }
.team-table th { font-size: .78rem; color: var(--encre-3); font-weight: 800; border-bottom: 1px solid var(--ligne); padding: .7rem 1rem; letter-spacing: .03em; text-transform: uppercase; }
.team-table td { padding: .8rem 1rem; vertical-align: middle; border-bottom: 1px solid var(--bleu-ghost); }
.team-table tr:last-child td { border-bottom: 0; }
.team-table tr.is-link { cursor: pointer; }
.team-table tr.is-link:hover td { background: var(--bleu-ghost); }
.contact-cell a { display: flex; align-items: center; gap: .35rem; color: var(--encre-2); font-size: .92rem; white-space: nowrap; }
.filters { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.tabs a { text-decoration: none; font-weight: 700; color: var(--encre-2); padding: .45rem .95rem; border-radius: 999px; border: 1px solid transparent; }
.tabs a span { color: var(--encre-3); font-weight: 600; font-size: .85rem; margin-left: .2rem; }
.tabs a:hover { background: #fff; border-color: var(--ligne); }
.tabs a.active { background: var(--bleu); color: #fff; }
.tabs a.active span { color: var(--eau-pale); }
.search { display: flex; gap: .5rem; }
.search .form-control { min-width: 240px; border-radius: 999px; padding-left: 1rem; }
.facts { margin: 0; }
.facts div { display: grid; grid-template-columns: 150px 1fr; gap: .5rem; padding: .5rem 0; border-bottom: 1px dashed var(--ligne); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--encre-3); font-weight: 600; }
.facts dd { margin: 0; }
.facts .quote { background: var(--bleu-ghost); border-radius: 8px; padding: .6rem .8rem; }
.rights { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.rights li { display: grid; grid-template-columns: 20px 110px 1fr auto; align-items: center; gap: .5rem; padding: .3rem .5rem; border-radius: 8px; background: var(--bleu-ghost); }
.rights li.is-none { background: transparent; color: var(--encre-3); }
.rights li.is-none strong { color: var(--encre-3); font-weight: 600; }
.rights li strong { color: var(--bleu); }
.rights li span { color: var(--encre-2); font-size: .92rem; }
.rights-compact li { grid-template-columns: 18px 95px 1fr; padding: .2rem .4rem; font-size: .9rem; background: transparent; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: .45rem 0 .45rem 1.5rem; border-bottom: 1px dashed var(--ligne); }
.timeline li:last-child { border-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: .1rem; top: 1rem; width: 10px; height: 10px; border-radius: 50%; background: var(--bleu-3); }
.timeline li.kind-security::before { background: var(--eau); }
.timeline li.kind-user::before { background: var(--flamme); }
.timeline li.kind-profile::before, .timeline li.kind-settings::before { background: var(--c5); }
.timeline span { display: block; font-size: .78rem; color: var(--encre-3); }

/* ---- Modules ---- */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
.module-grid-lg { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.module-card { display: flex; flex-direction: column; gap: .3rem; padding: 1rem 1.1rem; border-radius: 14px; border: 1px solid var(--ligne); background: var(--bleu-ghost); color: var(--encre); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
a.module-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; color: var(--encre); background: #fff; }
.module-card .icon { width: 28px; height: 28px; color: var(--bleu-2); }
.module-card strong { font-family: var(--font-display); font-weight: 600; color: var(--bleu); font-size: 1.05rem; }
.module-card small { color: var(--encre-2); line-height: 1.35; }
.module-card.is-upcoming { background: #fff; border-style: dashed; color: var(--encre-3); }
.module-card.is-upcoming .icon, .module-card.is-upcoming strong { color: var(--encre-3); }

/* ---- Options radio (profil, couleur) ---- */
.profile-options { display: grid; gap: .5rem; }
.profile-option { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; border: 2px solid var(--ligne); border-radius: 12px; cursor: pointer; background: #fff; transition: border-color .15s ease, background .15s ease; }
.profile-option:hover { border-color: var(--bleu-3); }
.profile-option.is-checked { border-color: var(--bleu-2); background: var(--bleu-ghost); }
.profile-option.is-disabled { opacity: .7; cursor: not-allowed; }
.profile-option-input { margin: 0; flex: 0 0 auto; width: 1.15rem; height: 1.15rem; }
.profile-option-body { display: flex; flex-direction: column; line-height: 1.25; }
.profile-option-body strong { color: var(--bleu); }
.profile-option-body small { color: var(--encre-2); }
.swatch-options { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.swatch-option { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatch-option.is-checked { border-color: var(--bleu); }
.swatch-option-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch-option .swatch-lg { width: 26px; height: 26px; }

/* ---- Profils (cartes) ---- */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.1rem; }
.profile-card { display: flex; flex-direction: column; gap: .7rem; background: #fff; border: 1px solid var(--ligne); border-top: 5px solid var(--bleu); border-radius: var(--radius); padding: 1.2rem 1.3rem; color: var(--encre); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.profile-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; color: var(--encre); }
.profile-card-head { display: flex; align-items: center; gap: .7rem; }
.profile-card-head strong { display: block; font-family: var(--font-display); font-size: 1.15rem; color: var(--bleu); line-height: 1.1; }
.profile-card-head small { color: var(--encre-3); }
.profile-card p { margin: 0; color: var(--encre-2); font-size: .95rem; }
.profile-card-cta { margin-top: auto; font-weight: 800; color: var(--bleu-2); display: inline-flex; align-items: center; gap: .2rem; }

/* ---- Matrice des droits ---- */
.matrix-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .5rem 1.25rem; padding: 1rem 1.25rem; background: var(--bleu-ghost); border-bottom: 1px solid var(--ligne); font-size: .88rem; color: var(--encre-2); }
.matrix-legend strong { color: var(--bleu); }
.matrix { --bs-table-bg: transparent; margin: 0; }
.matrix th, .matrix td { vertical-align: middle; padding: .75rem .9rem; border-bottom: 1px solid var(--bleu-ghost); }
.matrix thead th { font-size: .8rem; color: var(--encre-3); text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--ligne); }
.matrix-col-head, .matrix td[data-label] { text-align: center; }
.matrix-col-toggle { background: none; border: 0; padding: .2rem .5rem; border-radius: 8px; font: inherit; color: var(--bleu-2); font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.matrix-col-toggle:hover { background: var(--bleu-pale); }
.matrix-module { display: flex; align-items: center; gap: .7rem; }
.matrix-module .icon { color: var(--bleu-2); }
.matrix-module strong { display: block; color: var(--bleu); font-size: 1rem; }
.matrix-module small { display: block; color: var(--encre-3); font-weight: 400; line-height: 1.3; }
.matrix tr.is-upcoming .matrix-module .icon, .matrix tr.is-upcoming .matrix-module strong { color: var(--encre-3); }
.matrix tr.has-access .matrix-module .icon { color: var(--flamme-fonce); }
.matrix-summary { white-space: nowrap; font-size: .9rem; color: var(--encre-2); }
.matrix-summary .btn-link { padding: 0 .4rem; }
.switch { position: relative; display: inline-block; width: 48px; height: 28px; margin: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track { position: absolute; inset: 0; background: var(--ligne); border-radius: 999px; transition: background .15s ease; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s ease; }
.switch input:checked + .switch-track { background: var(--vert); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--flamme); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: .55; cursor: not-allowed; }
.danger-zone { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .5rem; }

/* ---- Formulaires ---- */
.form-label { font-weight: 700; color: var(--encre); margin-bottom: .3rem; }
.form-control, .form-select { border-radius: 10px; border-color: var(--ligne); padding: .6rem .85rem; }
.form-control:focus, .form-select:focus { border-color: var(--bleu-3); box-shadow: 0 0 0 .25rem rgba(42, 127, 168, .2); }
.form-text { color: var(--encre-3); }
.form-check-input:checked { background-color: var(--bleu-2); border-color: var(--bleu-2); }
.invalid-feedback { font-weight: 600; }
.pw-meter { margin-top: .5rem; }
.pw-bar { height: 6px; border-radius: 999px; background: var(--ligne); overflow: hidden; }
.pw-bar span { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .2s ease, background .2s ease; background: var(--rouge); }
.pw-bar span.level-1 { width: 30%; background: var(--rouge); }
.pw-bar span.level-2 { width: 60%; background: var(--flamme); }
.pw-bar span.level-3 { width: 85%; background: var(--vert); }
.pw-bar span.level-4 { width: 100%; background: var(--vert-fonce); }
.pw-checks { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .82rem; color: var(--encre-3); }
.pw-checks li::before { content: '○ '; }
.pw-checks li.is-ok { color: var(--vert-fonce); font-weight: 700; }
.pw-checks li.is-ok::before { content: '✓ '; }

/* ---- Pages sans navigation (connexion, mots de passe, erreurs) ---- */
body.bare { background: var(--papier); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.auth-side { background: linear-gradient(160deg, var(--bleu) 0%, var(--bleu-2) 60%, var(--eau-fonce) 100%); color: #fff; display: flex; align-items: center; padding: 3rem; position: relative; overflow: hidden; }
.auth-side::after { content: ''; position: absolute; right: -120px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%; background: rgba(238, 138, 42, .18); }
.auth-side-inner { position: relative; max-width: 26rem; }
.auth-side .brand-text strong { font-size: 1.5rem; }
.auth-tagline { font-family: var(--font-display); font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.2; margin: 2rem 0 1.2rem; font-weight: 600; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; color: var(--eau-pale); }
.auth-points li::before { content: '✓  '; color: var(--flamme); font-weight: 800; }
.auth-card { display: flex; flex-direction: column; justify-content: center; padding: 3rem clamp(1.5rem, 6vw, 5rem); max-width: 40rem; }
.auth-card h1 { font-size: clamp(1.9rem, 3.5vw, 2.6rem); }
.auth-card .lead-text { margin-bottom: 1.5rem; }
.auth-foot { margin: 1.5rem 0 0; }
.auth-foot a { font-weight: 700; }
@media (max-width: 991.98px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-side { padding: 2rem 1.5rem; }
    .auth-tagline { margin: 1rem 0 .8rem; font-size: 1.3rem; }
    .auth-points { display: none; }
    .auth-card { padding: 2rem 1.5rem 3rem; max-width: none; }
}

/* ---- Mobile : navigation en bas, tableaux en cartes ---- */
@media (max-width: 767.98px) {
    .topbar-inner { padding: .5rem 1rem; gap: .75rem; }
    .brand-text small { display: none; }
    .user-name { display: none; }
    .topnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--ligne); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; padding: .3rem .3rem calc(.3rem + env(safe-area-inset-bottom)); box-shadow: 0 -8px 20px -16px rgba(11, 61, 92, .6); }
    .topnav a { flex-direction: column; gap: .15rem; color: var(--encre-3); font-size: .7rem; padding: .35rem .2rem; border-radius: 10px; }
    .topnav a .icon { width: 22px; height: 22px; }
    .topnav a.active { background: var(--bleu-ghost); color: var(--bleu-2); }
    .topnav a:hover { background: var(--bleu-ghost); color: var(--bleu-2); }
    .main { padding: 1.25rem 1rem 6rem; }
    .page-head { margin-bottom: 1.1rem; }
    .team-table thead { display: none; }
    .team-table tr { display: block; padding: .6rem .9rem; border-bottom: 1px solid var(--ligne); }
    .team-table td { display: block; padding: .2rem 0; border: 0; }
    .team-table td[data-label="Dernière connexion"]::before { content: 'Dernière connexion : '; }
    .contact-cell a { display: inline-flex; margin-right: .8rem; }
    .facts div { grid-template-columns: 1fr; gap: 0; }
    .rights li { grid-template-columns: 20px 1fr auto; }
    .rights li span { grid-column: 2 / -1; }
    .matrix thead .matrix-col-head, .matrix-summary-head { display: none; }
    .matrix tr { display: block; padding: .6rem .9rem; border-bottom: 1px solid var(--ligne); }
    .matrix th[scope="row"], .matrix td { display: block; padding: .3rem 0; border: 0; text-align: left; }
    .matrix td[data-label] { display: flex; justify-content: space-between; align-items: center; }
    .matrix td[data-label]::before { content: attr(data-label); font-weight: 700; color: var(--encre-2); }
    .matrix-legend { grid-template-columns: 1fr; }
    .filters { flex-direction: column; align-items: stretch; }
    .search .form-control { min-width: 0; flex: 1; }
}

/* ---- Heures ---- */
.week-nav { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.week-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 12rem; }
.week-title strong { font-family: var(--font-display); font-size: 1.05rem; color: var(--bleu); }
.week-title span { color: var(--encre-3); font-size: .85rem; }
.person-picker .form-select { min-width: 14rem; }
.hours-table td { vertical-align: top; }
.hours-table tr.is-weekend td { background: var(--papier); color: var(--encre-3); }
.hours-table tr.is-today td:first-child strong { color: var(--flamme-fonce); }
.hours-table tfoot th { padding: .8rem 1rem; border-top: 2px solid var(--ligne); font-size: .95rem; }
.hour-items { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.hour-items li { display: flex; align-items: center; gap: .5rem; }
.hour-items li > span { flex: 1; min-width: 0; }
.hour-items li em { font-style: normal; font-weight: 700; color: var(--bleu-2); white-space: nowrap; }
.hour-items li.is-report .icon { color: var(--vert); }
.hour-items li.is-entry .icon { color: var(--eau-fonce); }
.hour-items li.is-compensation .icon { color: var(--flamme); }
.hour-items li.is-compensation em { color: var(--flamme-fonce); }
.hour-edit { color: var(--encre-3); display: inline-flex; padding: .15rem; border-radius: 6px; }
.hour-edit:hover { color: var(--bleu-2); background: var(--bleu-ghost); }
.hour-add { display: inline-flex; align-items: center; gap: .2rem; margin-top: .35rem; font-size: .85rem; font-weight: 700; text-decoration: none; }
.tile-delta.is-positive strong, .delta.is-positive { color: var(--vert-fonce); }
.tile-delta.is-negative strong, .delta.is-negative { color: var(--rouge-fonce); }
.delta { font-weight: 800; }
.card-head-inset { padding: 1.1rem 1rem .4rem; }
.hours-team-table th.text-end, .hours-team-table td.text-end { white-space: nowrap; }

/* ---- Rapports d'intervention ---- */
.status-draft { background: var(--ambre-pale); color: var(--ambre); }
.status-signed { background: var(--vert-pale); color: var(--vert-fonce); }
.status-sent { background: var(--bleu-pale); color: var(--bleu-2); }
.duration-field { display: flex; align-items: center; gap: .4rem; }
.duration-field .duration-hours { width: 5rem; }
.duration-field .duration-minutes { width: 5.5rem; }
.duration-field span { color: var(--encre-2); font-weight: 600; }
.report-text { white-space: pre-line; font-size: 1.05rem; margin-bottom: 0; }
.report-subhead { font-size: .95rem; font-weight: 800; color: var(--encre-2); margin: 1rem 0 .4rem; }
.supplies { margin: 0; padding-left: 1.2rem; }
.supplies li { padding: .15rem 0; }
.people-inline { display: flex; flex-wrap: wrap; gap: .4rem 1rem; list-style: none; margin: 0; padding: 0; }
.people-inline .person { display: inline-flex; align-items: center; gap: .4rem; }
.signature-pad { border: 2px dashed var(--bleu-pale); border-radius: 12px; background: var(--blanc); padding: .35rem; margin-bottom: .5rem; }
.signature-pad.has-signature { border-color: var(--vert); border-style: solid; }
.signature-pad canvas { display: block; width: 100%; touch-action: none; cursor: crosshair; border-radius: 8px; }
.signature-tools { display: flex; justify-content: space-between; align-items: center; padding: .2rem .4rem 0; }
.signature-view { margin: 0; }
.signature-view img { display: block; max-height: 120px; max-width: 100%; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 8px; padding: .4rem; }
.signature-view figcaption { color: var(--encre-2); font-size: .9rem; margin-top: .4rem; }
.report-list { list-style: none; margin: 0; padding: 0; }
.report-list li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px dashed var(--ligne); }
.report-list li:last-child { border-bottom: 0; }
.report-list a { text-decoration: none; color: var(--encre); }
.report-list a:hover strong { text-decoration: underline; }
.timeline li.kind-report::before { background: var(--vert); }
.postit--drafts { background: var(--ambre-pale); }

/* ---- Clients et chantiers ---- */
.status-archived { background: var(--papier); color: var(--encre-3); border: 1px solid var(--ligne); }
.status-offer { background: var(--ambre-pale); color: var(--ambre); }
.status-awarded { background: var(--bleu-pale); color: var(--bleu-2); }
.status-in_progress { background: var(--eau-pale); color: var(--eau-fonce); }
.status-done { background: var(--vert-pale); color: var(--vert-fonce); }
.site-number { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--bleu-2); letter-spacing: .02em; }
.site-table td .status + .person-sub { display: block; margin-top: .25rem; }
.stepper { list-style: none; margin: .25rem 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.stepper li { position: relative; display: flex; flex-direction: column; align-items: center; gap: .4rem; text-align: center; font-size: .85rem; font-weight: 700; color: var(--encre-3); }
.stepper li::before { content: ''; position: absolute; top: 15px; right: 50%; left: -50%; height: 3px; background: var(--ligne); }
.stepper li:first-child::before { display: none; }
.stepper li.is-done::before, .stepper li.is-current::before { background: var(--vert); }
.stepper .step-mark { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--blanc); border: 2px solid var(--ligne); font-family: var(--font-display); font-weight: 700; }
.stepper .step-mark .icon { width: 16px; height: 16px; }
.stepper li.is-done { color: var(--vert-fonce); }
.stepper li.is-done .step-mark { background: var(--vert); border-color: var(--vert); color: #fff; }
.stepper li.is-current { color: var(--encre); }
.stepper li.is-current .step-mark { border-color: var(--flamme); color: var(--flamme-fonce); box-shadow: 0 0 0 4px var(--flamme-pale); }
.stepper.is-archived li { opacity: .55; }
.stage-hint { color: var(--encre-2); margin-bottom: 1rem; }
.timeline li.kind-customer::before { background: var(--c7); }
.timeline li.kind-site::before { background: var(--eau-fonce); }
.postit--offers { background: var(--ambre-pale); }
.postit--sites { background: var(--eau-pale); }
@media (max-width: 575px) { .stepper { grid-template-columns: repeat(2, 1fr); row-gap: 1rem; } .stepper li::before { display: none; } }
