/* ==========================================================================
   DIRINA — Feuille de style
   Charte : noir #111 · bleu #38B6FF · blanc · Oswald (titres) · Open Sans (texte)
   Polices auto-hébergées (aucun appel à Google : conforme RGPD)
   ========================================================================== */

@font-face { font-family: "Oswald"; font-weight: 400; font-display: swap; src: url("fonts/oswald-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-weight: 500; font-display: swap; src: url("fonts/oswald-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 400; font-display: swap; src: url("fonts/open-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 600; font-display: swap; src: url("fonts/open-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 700; font-display: swap; src: url("fonts/open-sans-latin-700-normal.woff2") format("woff2"); }

:root {
    --ink: #111111;
    --ink-2: #3a3d44;
    --muted: #7a7f8a;
    --line: #e8eaee;
    --line-2: #f0f1f4;
    --bg: #f6f7f9;
    --white: #ffffff;
    --blue: #38b6ff;
    --blue-ink: #0b7fc2;
    --blue-soft: #eaf7ff;
    --ok: #1f9d55;      --ok-soft: #e8f6ee;
    --warn: #b7791f;    --warn-soft: #fdf4e3;
    --danger: #d64545;  --danger-soft: #fdecec;
    --solid: #111111;   --on-solid: #ffffff;
    --hover: #fafbfc;   --sunken: #eef0f3;   --line-strong: #d8dbe1;
    --danger-line: #f3c4c4; --warn-line: #f0d9a8; --doc-soft: #ecf0fe; --doc-ink: #3b5bdb;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(17, 17, 17, .04), 0 4px 16px rgba(17, 17, 17, .04);
    --sidebar: 252px;
    --title: "Oswald", "Arial Narrow", sans-serif;
    --text: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 14.5px/1.55 var(--text); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 500; }
p { margin: 0 0 .75rem; }
code { font-size: .9em; background: var(--line-2); padding: .1em .35em; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.block { display: block; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.truncate { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Icônes ---------- */
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.ic-xs { width: 13px; height: 13px; vertical-align: -2px; }
.ic-lg { width: 28px; height: 28px; }
.ic-xl { width: 44px; height: 44px; stroke-width: 1.3; }

/* ---------- Logo ---------- */
.logo-mark { width: 44px; height: 44px; flex: none; }
.logo-xl { width: 92px; height: 92px; }
.brand { display: flex; align-items: center; gap: 2px; padding: 22px 22px 18px; }
.brand-word { font: 400 25px/1 var(--title); letter-spacing: .42em; margin-left: 2px; }

/* ==========================================================================
   Structure
   ========================================================================== */
.app { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
    display: flex; flex-direction: column; background: var(--white); border-right: 1px solid var(--line);
}
.sidebar-company { margin: -6px 22px 14px; padding: 8px 12px; font-size: 12.5px; font-weight: 600; background: var(--bg); border-radius: var(--radius-sm); }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 12px; flex: 1; overflow-y: auto; }
.nav-link {
    position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 600; font-size: 14px; transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--bg); color: var(--ink); }
.nav-link.is-active { background: var(--blue-soft); color: var(--ink); }
.nav-link.is-active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue); }
.nav-link.is-active .ic { color: var(--blue-ink); }
.nav-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--solid); color: var(--on-solid); font-size: 11.5px; text-align: center; }
.sidebar-foot { border-top: 1px solid var(--line); padding: 16px 18px 18px; }
.me { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.me-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.me-text strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { color: var(--muted); font-size: 12px; }
.me-links { display: flex; justify-content: space-between; gap: 8px; }
.me-links a, .linklike { display: inline-flex; align-items: center; gap: 6px; font: 600 12.5px var(--text); color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; }
.me-links a:hover, .linklike:hover { color: var(--ink); }
.me-links .ic { width: 15px; height: 15px; }

.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 28px 36px 6px; }
.topbar-title { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.topbar h1 { font: 500 28px/1.15 var(--title); letter-spacing: .01em; }
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.topbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back-link { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--white); border: 1px solid var(--line); color: var(--ink-2); flex: none; }
.back-link:hover { border-color: var(--ink); color: var(--ink); }
.content { padding: 18px 36px 48px; display: flex; flex-direction: column; gap: 20px; max-width: 1400px; width: 100%; }
.topbar .menu-btn { display: none; }
.backdrop { display: none; }

/* ---------- Grilles ---------- */
.grid-main { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-main > *, .grid-side > *, .card-hero > *, .grid-2 > *, .grid-3 > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.narrow { max-width: 480px; }
.narrow-wide { max-width: 860px; width: 100%; }

/* ---------- Cartes ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font: 500 17px/1.2 var(--title); letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
.card-accent { border-color: var(--blue); background: linear-gradient(180deg, var(--blue-soft), var(--white) 70%); }
.card-accent h2 { font: 500 18px var(--title); display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.card-hero { display: grid; grid-template-columns: 1fr 1.25fr; gap: 28px; align-items: center; }
.card-hero h2 { font: 500 24px/1.2 var(--title); margin-bottom: 8px; }
details.card > summary { list-style: none; cursor: pointer; margin: 0; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: 14px; }
.link { color: var(--blue-ink); font-weight: 600; font-size: 13px; }
.link:hover { text-decoration: underline; }

/* ---------- Statistiques ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.stat:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.stat strong { display: block; font: 500 30px/1 var(--title); }
.stat small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; flex: none; }
.stat-icon .ic { width: 22px; height: 22px; }
.tone-warn { background: var(--warn-soft); color: var(--warn); }
.tone-danger { background: var(--danger-soft); color: var(--danger); }
.tone-info { background: var(--blue-soft); color: var(--blue-ink); }
.tone-dark { background: var(--solid); color: var(--on-solid); }
.pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pill-stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pill-stat strong { display: block; font: 500 24px/1.1 var(--title); color: var(--ink); }
.pill-stat:hover { border-color: var(--ink); }

/* ---------- Listes ---------- */
.list { list-style: none; margin: 0 -10px; padding: 0; }
.list-item { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius-sm); }
.list-item:hover { background: var(--bg); }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.list-meta { color: var(--muted); font-size: 12.5px; }
.empty { color: var(--muted); padding: 14px 0; margin: 0; }
.empty-state { text-align: center; padding: 56px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-state h2 { font: 500 22px var(--title); }
.empty-code { font: 500 64px/1 var(--title); color: var(--blue); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--hover); white-space: nowrap; }
.table td { padding: 13px 18px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table-dense td { padding: 9px 18px; font-size: 13px; }
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--hover); }
.is-archived { opacity: .55; }
.row-alert td { background: var(--danger-soft); }
.file-cell { display: flex; align-items: center; gap: 12px; }
.file-cell > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.file-cell strong { word-break: break-word; }
.person { display: flex; align-items: center; gap: 10px; }
.person > span:not(.avatar) { display: flex; flex-direction: column; }

/* ---------- Pastilles fichiers ---------- */
.ft { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; font: 700 10px var(--text); letter-spacing: .03em; flex: none; }
.ft-pdf { background: #fdecec; color: #c53030; }
.ft-img { background: var(--blue-soft); color: var(--blue-ink); }
.ft-xls { background: var(--ok-soft); color: var(--ok); }
.ft-doc { background: var(--doc-soft); color: var(--doc-ink); }
.ft-other { background: var(--line-2); color: var(--muted); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-muted { background: var(--line-2); color: var(--ink-2); }
.badge-info { background: var(--blue-soft); color: var(--blue-ink); }
.badge-blue { background: var(--blue-soft); color: var(--blue-ink); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-dark { background: var(--solid); color: var(--on-solid); }
.due-late { color: var(--danger); font-weight: 700; }
.due-soon { color: var(--warn); font-weight: 700; }

/* ---------- Avatars ---------- */
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--solid); color: var(--on-solid); font: 600 12px var(--text); flex: none; letter-spacing: .03em; }
.avatar-blue { background: var(--blue); color: var(--ink); }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.people li { display: flex; align-items: center; gap: 10px; }
.people li > span:not(.avatar) { display: flex; flex-direction: column; line-height: 1.3; }
.people small { color: var(--muted); font-size: 12px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font: 600 14px var(--text); cursor: pointer; transition: background .15s, border-color .15s, transform .1s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-dark { background: var(--solid); color: var(--on-solid); }
.btn-dark:hover { background: #2b2d31; }
.btn-light { background: var(--white); border-color: var(--line); color: var(--ink); }
.btn-light:hover { border-color: var(--ink); }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: none; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.inline-form { display: inline; margin: 0; }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form .card { display: flex; flex-direction: column; gap: 14px; }
.form .card .card-head { margin-bottom: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { font-weight: 400; color: var(--muted); }
.field-short { max-width: 220px; }
input[type=text], input:not([type]), input[type=email], input[type=password], input[type=search], input[type=tel], input[type=date], select, textarea {
    width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--white);
    font: 400 14.5px var(--text); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 11px 14px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 36px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a7f8a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(56, 182, 255, .18); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--ink); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

.segmented { display: flex; gap: 10px; flex-wrap: wrap; }
.segmented label { flex: 1; min-width: 180px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; cursor: pointer; transition: all .15s; }
.segmented input:checked + span { border-color: var(--ink); background: var(--solid); color: var(--on-solid); }
.segmented input:focus-visible + span { box-shadow: 0 0 0 4px rgba(56, 182, 255, .25); }

.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-card { position: relative; display: flex; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.role-card input { margin-top: 3px; accent-color: var(--ink); }
.role-card span { display: flex; flex-direction: column; }
.role-card small { color: var(--muted); font-size: 12.5px; }
.role-card:has(input:checked) { border-color: var(--ink); background: var(--hover); }
.role-panel { padding-top: 4px; }
.role-panel[hidden] { display: none; }

/* ---------- Barre d'outils / onglets ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar select { width: auto; min-width: 200px; }
.search { position: relative; flex: 1; min-width: 240px; }
.search .ic { position: absolute; left: 14px; top: 13px; color: var(--muted); }
.search input { padding-left: 42px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { padding: 10px 14px; font-weight: 600; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--blue); }
.pager { display: flex; gap: 6px; justify-content: center; }
.pager a { display: grid; place-items: center; min-width: 36px; height: 36px; border-radius: 8px; background: var(--white); border: 1px solid var(--line); font-weight: 600; }
.pager a.is-active { background: var(--solid); color: var(--on-solid); border-color: var(--ink); }

.select-status { height: 34px; width: auto; font-size: 13px; font-weight: 600; border-radius: 99px; padding: 0 32px 0 12px; background-position: right 10px center; }
.status-a_traiter { background-color: var(--warn-soft); color: var(--warn); border-color: transparent; }
.status-en_attente { background-color: var(--blue-soft); color: var(--blue-ink); border-color: transparent; }
.status-transmis { background-color: var(--ok-soft); color: var(--ok); border-color: transparent; }

/* ---------- Dépôt de fichiers ---------- */
.upload { display: flex; flex-direction: column; gap: 12px; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 18px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--hover); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--blue); background: var(--blue-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .ic { color: var(--blue-ink); }
.dz-title { font-weight: 600; }
.dz-hint { font-size: 12px; color: var(--muted); }
.dz-files { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.dz-files:empty { display: none; }
.upload-row { display: flex; gap: 10px; flex-wrap: wrap; }
.upload-row select { flex: 1; min-width: 160px; }
.upload-compact .dropzone { padding: 16px; flex-direction: row; justify-content: center; gap: 10px; flex-wrap: wrap; }
.upload-compact .ic-lg { width: 20px; height: 20px; }
.upload-compact .dz-hint { width: 100%; }
.upload-compact { margin-bottom: 14px; }

/* ---------- Fiches ---------- */
.dl { display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px; margin: 0; font-size: 13.5px; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; word-break: break-word; }
.note { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); font-size: 13px; }
.credentials { white-space: pre-wrap; background: var(--solid); color: var(--on-solid); padding: 16px 18px; border-radius: 10px; font: 13.5px/1.6 ui-monospace, Menlo, Consolas, monospace; margin: 8px 0 12px; }

/* ---------- Tâche & échanges ---------- */
.task-head { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.prose { font-size: 15px; line-height: 1.7; }
.task-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.thread { display: flex; flex-direction: column; gap: 16px; margin-bottom: 18px; }
.msg { display: flex; gap: 12px; max-width: 88%; }
.msg-body { background: var(--bg); border-radius: 4px 14px 14px 14px; padding: 10px 14px; min-width: 0; }
.msg-mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-mine .msg-body { background: var(--blue-soft); border-radius: 14px 4px 14px 14px; }
.msg-internal .msg-body { background: var(--warn-soft); }
.msg-meta { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 2px; }
.msg-flag { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); font-weight: 700; }
.msg-text { word-break: break-word; }
.composer { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line-2); padding-top: 16px; }
.composer-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Messages flash ---------- */
.flash { position: relative; margin: 0 36px; padding: 12px 44px 12px 16px; border-radius: 10px; font-weight: 600; font-size: 13.5px; }
.content .flash, .guest .flash, .form .flash, .card .flash { margin: 0 0 14px; }
.main > .flash { margin-top: 14px; }
.flash-success { background: var(--ok-soft); color: #17673a; }
.flash-error { background: var(--danger-soft); color: #a12d2d; }
.flash-info { background: var(--blue-soft); color: #075f92; }
.flash-close { position: absolute; right: 10px; top: 7px; border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }

/* ==========================================================================
   Pages publiques (connexion)
   ========================================================================== */
.guest { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; background: var(--white); }
.guest-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 64px 8%; background: #0c0d10; color: #fff; }
.guest-hero::after { content: ""; position: absolute; right: -140px; bottom: -140px; width: 420px; height: 420px; border-radius: 50%; border: 1px solid rgba(56, 182, 255, .35); box-shadow: 0 0 0 60px rgba(56, 182, 255, .05), 0 0 0 120px rgba(56, 182, 255, .03); }
.guest-brand { display: flex; align-items: center; gap: 4px; }
.guest-brand .logo-mark g { fill: #fff; }
.guest-brand .brand-word { font-size: 56px; letter-spacing: .4em; }
.guest-tagline { font-size: 18px; margin: 18px 0 40px; color: rgba(255, 255, 255, .85); }
.guest-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.guest-points li { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .78); }
.guest-points .ic { color: var(--blue); }
.guest-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px 24px; }
.guest-box { width: 100%; max-width: 400px; }
.guest-title { font: 500 32px var(--title); margin-bottom: 4px; }
.guest-box .form { margin: 26px 0 18px; }
.guest-foot { margin-top: 40px; font-size: 12px; color: var(--muted); }


/* ---------- RGPD / zone sensible ---------- */
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b83232; }
.btn-ghost-danger { background: var(--white); border-color: var(--line); color: var(--danger); }
.btn-ghost-danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.card .btn-block + .btn-block, .card form + .btn-block { margin-top: 10px; }
.card-danger { border-color: var(--danger-line); }
.card-danger h2 { font: 500 22px var(--title); color: var(--danger); display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.purge-list { margin: 0 0 14px; padding-left: 20px; }
.legal-links { margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.legal-links a:hover, .guest-foot a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Fichiers effacés après transmission ---------- */
.is-purged { opacity: .62; }
.is-purged:hover { background: none; }
.purge-hint { color: var(--ok); font-weight: 600; }


/* ---------- Embauches ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.board-col { background: var(--sunken); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 160px; }
.board-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; }
.board-head h2 { font: 500 15px var(--title); letter-spacing: .03em; text-transform: uppercase; flex: 1; }
.board-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.board-dpae .board-dot { background: var(--danger); }
.board-contrat .board-dot { background: var(--warn); }
.board-signature .board-dot { background: var(--blue); }
.board-archive .board-dot { background: var(--ok); }
.board-count { min-width: 24px; padding: 1px 8px; border-radius: 99px; background: var(--white); font-size: 12px; font-weight: 700; text-align: center; }
.board-note, .board-empty { font-size: 12px; color: var(--muted); margin: 0 4px; }
.emb-card { display: flex; flex-direction: column; gap: 6px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.emb-card:hover { transform: translateY(-2px); border-color: var(--ink); }
.emb-card.is-late { border-color: var(--danger-line); background: var(--danger-soft); }
.emb-name { font-weight: 700; }
.emb-company { font-size: 12px; color: var(--muted); margin-top: -4px; }
.emb-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.emb-dates { font-size: 12.5px; color: var(--ink-2); }
.emb-alert { font-size: 12px; font-weight: 700; color: var(--danger); }
.emb-purge { font-size: 12px; color: var(--ok); font-weight: 600; }

.emb-panel { border-color: var(--ink); }
.stepper { list-style: none; margin: 4px 0 18px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); counter-reset: s; }
.stepper li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.stepper li::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper li.is-done::before, .stepper li.is-current::before { background: var(--solid); }
.step-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--white); border: 2px solid var(--line); font-weight: 700; font-size: 13px; color: var(--muted); }
.is-done .step-dot { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.is-current .step-dot { border-color: var(--blue); color: var(--ink); box-shadow: 0 0 0 4px rgba(56, 182, 255, .2); }
.step-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.is-done .step-label, .is-current .step-label { color: var(--ink); }
.step-date { font-size: 11.5px; color: var(--muted); min-height: 1em; }
.dl-inline { grid-template-columns: 130px 1fr; margin-bottom: 6px; }
.step-hint { width: 100%; margin: 0; }
.emb-panel .flash { margin: 10px 0 0; }
.emb-docs { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.emb-docs .upload-compact { margin: 6px 0 0; }

/* ---------- Demandes de contact ---------- */
.nav-count-blue { background: var(--blue); color: var(--ink); }
.prospects { display: flex; flex-direction: column; gap: 16px; }
.prospect-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.prospect-head h2 { font: 500 20px var(--title); }
.prospect-head p { margin: 2px 0 0; }
.prospect-contact { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.prospect-msg { margin-top: 14px; padding: 14px 16px; background: var(--bg); border-radius: 10px; }
.guest-back { position: absolute; top: 28px; left: 8%; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.7); }
.guest-back:hover { color: #fff; }


/* ---------- Suivi des temps ---------- */
.chrono { display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 6px 0 16px; border-radius: 99px; background: var(--solid); color: var(--on-solid); }
.chrono-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff5a5a; box-shadow: 0 0 0 0 rgba(255,90,90,.6); animation: chrono-pulse 1.6s infinite; flex: none; display: inline-block; }
@keyframes chrono-pulse { 70% { box-shadow: 0 0 0 8px rgba(255,90,90,0); } 100% { box-shadow: 0 0 0 0 rgba(255,90,90,0); } }
.chrono-time { font: 500 17px/1 var(--title); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.chrono-label { font-size: 12.5px; color: rgba(255,255,255,.7); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chrono-stop { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border-radius: 99px; border: 0; background: var(--blue); color: var(--ink); font: 700 12.5px var(--text); cursor: pointer; }
.chrono-stop:hover { background: var(--on-solid); }
.chrono-pop { position: relative; }
.chrono-pop > summary { list-style: none; cursor: pointer; }
.chrono-pop > summary::-webkit-details-marker { display: none; }
.chrono-form { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 300px; padding: 18px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px rgba(17,17,17,.12); display: flex; flex-direction: column; gap: 12px; }
.chrono-note { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; font-weight: 600; }
.task-chrono { margin: 16px 0 8px; }
.month-bar { display: flex; align-items: center; gap: 14px; }
.month-bar strong { font: 500 22px var(--title); min-width: 170px; text-align: center; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13px; }
.lock-form { display: flex; gap: 8px; align-items: center; }
.lock-form input { height: 36px; width: 130px; font-size: 13px; padding: 0 10px; }
.releve-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.releve-head h2 { font: 500 28px var(--title); }
.releve-head p { margin: 0 0 4px; }
.releve-brand { display: flex; align-items: center; gap: 2px; }
.releve-brand .brand-word { font-size: 18px; }
.releve-brand .logo-mark { width: 34px; height: 34px; }
.releve-total { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; max-width: 380px; margin: 20px 0 0 auto; padding-top: 16px; border-top: 2px solid var(--ink); }
.releve-total span { color: var(--muted); }
.releve-total strong { text-align: right; }
.releve-total .big { font: 500 24px var(--title); }
@media (max-width: 760px) {
    .stats-3 { grid-template-columns: 1fr; }
    .chrono-label { display: none; }
    .chrono-form { position: fixed; left: 16px; right: 16px; top: 80px; width: auto; }
    .lock-form { flex-wrap: wrap; }
    .lock-form input { width: 100%; }
}
@media print {
    .sidebar, .topbar, .no-print, .flash, .backdrop { display: none !important; }
    .main { margin: 0; }
    .content { padding: 0; }
    .card { box-shadow: none; border: 0; padding: 0; }
    body { background: #fff; }
}

/* ---------- Pages de texte (mentions, confidentialité) ---------- */
.doc { background: var(--white); }
.doc-head { display: flex; justify-content: space-between; align-items: center; max-width: 860px; margin: 0 auto; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.doc-head .brand { padding: 10px 0; }
.doc-body { max-width: 860px; margin: 0 auto; padding: 36px 24px 24px; line-height: 1.7; }
.doc-body h1 { font: 500 34px var(--title); margin-bottom: 18px; }
.doc-body h2 { font: 500 20px var(--title); margin: 30px 0 10px; }
.doc-body ul { padding-left: 20px; }
.doc-body .table td, .doc-body .table th { font-size: 13px; }
.doc-foot { max-width: 860px; margin: 0 auto; padding: 20px 24px 40px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }

/* ==========================================================================
   Responsive (tablette / mobile)
   ========================================================================== */
@media (max-width: 1180px) {
    .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .grid-side { grid-template-columns: 1fr; }
    .card-hero { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .25s; box-shadow: 0 0 40px rgba(0, 0, 0, .15); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(17, 17, 17, .35); z-index: 30; }
    .main { margin-left: 0; }
    .topbar .menu-btn { display: inline-grid; }
    .topbar { padding: 16px 18px 4px; flex-wrap: wrap; }
    .topbar h1 { font-size: 23px; }
    .topbar-actions { width: 100%; }
    .content { padding: 14px 18px 40px; }
    .flash { margin: 0 18px; }
    .grid-main, .grid-2, .grid-3, .role-grid { grid-template-columns: 1fr; }
    .guest { grid-template-columns: 1fr; }
    .guest-hero { padding: 36px 24px; }
    .guest-hero::after, .guest-points { display: none; }
    .guest-brand .brand-word { font-size: 38px; }
    .logo-xl { width: 64px; height: 64px; }
    .guest-tagline { margin: 10px 0 0; font-size: 15px; }
    .table th, .table td { padding: 11px 12px; }
}
@media (max-width: 520px) {
    .board { grid-template-columns: 1fr; }
    .step-label { font-size: 11px; }
    .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat { padding: 14px; gap: 10px; }
    .stat-icon { width: 38px; height: 38px; }
    .pills { grid-template-columns: 1fr; }
    .card { padding: 18px; }
    .toolbar select { width: 100%; }
    .msg { max-width: 100%; }
    .list-title { white-space: normal; word-break: break-word; }
    .list-item .badge { font-size: 11px; padding: 2px 8px; }
}

/* ---------- Téléphone : tableaux en cartes, cibles tactiles ---------- */
@media (max-width: 760px) {
    .table-responsive thead { display: none; }
    .table-responsive, .table-responsive tbody, .table-responsive tr, .table-responsive td { display: block; width: 100%; }
    .table-responsive tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
    .table-responsive tr:last-child { border-bottom: 0; }
    .table-responsive td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 5px 0 !important; border: 0 !important; text-align: right; font-size: 13.5px; }
    .table-responsive td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; text-align: left; }
    .table-responsive td:first-child { display: block; text-align: left; padding-bottom: 8px !important; font-size: 15px; }
    .table-responsive td:first-child::before { display: none; }
    .table-responsive td[data-label=""]::before, .table-responsive td:not([data-label])::before { display: none; }
    .table-responsive td.num { justify-content: space-between; }
    .table-responsive td:empty { display: none; }
    .table-responsive .file-cell { align-items: flex-start; }
    .table-responsive .select-status { max-width: 75%; }
    .table-responsive td { flex-wrap: wrap; }
    .table-responsive td .block, .table-responsive td > div.small { flex-basis: 100%; text-align: right; margin-top: -4px; }
    .table-wrap { overflow: visible; }
    .row-alert td { background: none; }
    .row-alert { background: var(--danger-soft); }
    .truncate { max-width: 60vw; }

    .tabs { scrollbar-width: none; }
    .tabs::-webkit-scrollbar { display: none; }
    .toolbar > * { flex: 1 1 100%; }
    .topbar-actions .btn { flex: 1; }
    .form-actions { flex-direction: column-reverse; align-items: stretch; }
    .form-actions .spacer { display: none; }
    .form-actions .btn { width: 100%; }
    .task-actions .btn { flex: 1 1 100%; }
    .dl, .dl-inline { grid-template-columns: 1fr; gap: 2px; }
    .dl dd { margin-bottom: 8px; }
    .stepper .step-date { display: none; }
    .grid-side > aside { order: 2; }
    .msg { max-width: 100%; }
    .prospect-contact .btn { flex: 1 1 100%; justify-content: flex-start; }
    .upload-row > * { flex: 1 1 100%; }
    .upload-row .btn { width: 100%; }
    input, select, textarea { font-size: 16px !important; } /* évite le zoom automatique sur iPhone */
    .sidebar { width: 84vw; max-width: 320px; }
}

.log-box { max-height: 420px; overflow: auto; font-size: 12px; white-space: pre-wrap; word-break: break-all; }

/* Double authentification */
.otp-input { text-align: center; font: 600 30px/1 var(--title) !important; letter-spacing: .35em; height: 64px !important; }
.resend { margin: 6px auto 4px; color: var(--blue-ink); text-decoration: underline; }

.reveal-pw > summary { list-style: none; }
.reveal-pw > summary::-webkit-details-marker { display: none; }
.reveal-pw[open] > summary { display: none; }
.reveal-pw .credentials { text-align: center; font-size: 13px; white-space: nowrap; overflow-x: auto; }

.settings-tile { display: flex; gap: 14px; align-items: flex-start; padding: 20px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.settings-tile:hover { border-color: var(--ink, #111); transform: translateY(-1px); }
.settings-tile h2 { font-size: 17px; margin: 0 0 4px; }
.settings-tile p { margin: 0; }
.settings-tile .tile-state { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 600; }
.tile-ok { color: #15803d; } .tile-ko { color: #b91c1c; }

/* ---------- Suivi d'équipe (v2.2) ---------- */
.btn-xs { height: 30px; padding: 0 10px; font-size: 12px; gap: 5px; white-space: nowrap; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; color: var(--blue-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--ink); }
.ft-task { background: var(--blue-soft); color: var(--blue-ink); }
.claim-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 150px; }
.claim { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 99px; white-space: nowrap; }
.claim-me { background: var(--blue-soft); color: var(--blue-ink); }
.claim-other { background: var(--warn-soft); color: var(--warn); }
.claim-done { background: var(--ok-soft); color: var(--ok); }
.claim-assign select { height: 28px; font-size: 12px; padding: 0 24px 0 8px; max-width: 130px; color: var(--muted); }
.claim-inline { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--blue-ink); }
.claim-inline.claim-none { color: var(--warn); }
.claim-box { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 10px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.claim-me-note, .claim-other-note { display: flex; gap: 6px; align-items: center; margin: 0; padding: 9px 11px; border-radius: var(--radius-sm); }
.claim-me-note { background: var(--blue-soft); color: var(--blue-ink); }
.claim-other-note { background: var(--warn-soft); color: var(--ink-2); }
.claim-box .link-btn { align-self: flex-start; }
.msg-system { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); padding: 6px 12px; margin-left: 46px; border-left: 2px solid var(--line); }
.msg-system .ic { color: var(--muted); }
.work-list .list-item { padding: 8px 6px; }
.work-list .list-main { text-decoration: none; color: inherit; }
.person-cell { display: flex; align-items: center; gap: 10px; }
.person-cell > span:not(.avatar) { display: flex; flex-direction: column; }
.person-cell small { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.composer-note { border-top: 0; padding-top: 0; margin-bottom: 18px; }
.composer-note textarea { background: var(--warn-soft); border-color: transparent; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed-day { font: 500 13px var(--title); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 6px; }
.feed-day:first-child { margin-top: 0; }
.feed-item { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.feed-item:last-child { border-bottom: 0; }
.feed-icon { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--line-2); color: var(--ink-2); }
.feed-note .feed-icon { background: var(--warn-soft); color: var(--warn); }
.feed-prise .feed-icon, .feed-attribution .feed-icon { background: var(--blue-soft); color: var(--blue-ink); }
.feed-statut .feed-icon { background: var(--ok-soft); color: var(--ok); }
.feed-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.feed-line { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; font-size: 13.5px; }
.feed-time { margin-left: auto; font-size: 12px; color: var(--muted); }
.feed-text { font-size: 13.5px; color: var(--ink-2); white-space: normal; overflow-wrap: anywhere; }
.feed-note .feed-text { background: var(--warn-soft); padding: 8px 11px; border-radius: var(--radius-sm); }
.feed-task { font-size: 12px; display: inline-flex; gap: 4px; align-items: center; }
.feed-del { margin-left: 2px; }
.feed-del .icon-btn { width: 24px; height: 24px; }
@media (max-width: 760px) { .msg-system { margin-left: 0; } }

.card-notes { border-color: var(--warn-line); }
.card-notes .card-head h2 .ic { color: var(--warn); }
.notes-hint { margin: -6px 0 12px; }

.text-warn { color: var(--warn); font-weight: 600; }
.people-sub { margin: 12px 0 6px; }
.contact-chip { display: inline-flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; margin-bottom: 14px; border-radius: 99px; background: var(--white); border: 1px solid var(--line); }
.contact-chip > span:not(.avatar) { display: flex; flex-direction: column; line-height: 1.25; }
.contact-chip small { font-size: 11.5px; color: var(--muted); }
.contact-chip strong { font-size: 14.5px; }
.absence-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.absence-form select { height: 32px; font-size: 13px; max-width: 170px; }
.how-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.field-medium { max-width: 360px; }

/* Bandeau cookies */
.cookie-banner { position: fixed; z-index: 9999; left: 50%; bottom: 20px; transform: translate(-50%, 20px); opacity: 0; width: min(760px, calc(100% - 32px)); display: flex; align-items: center; gap: 16px; padding: 16px 18px; background: #0f172a; color: #e2e8f0; border-radius: 16px; box-shadow: 0 18px 50px rgba(15, 23, 42, .35); font-size: 13.5px; line-height: 1.5; transition: opacity .25s ease, transform .25s ease; }
.cookie-banner.is-visible { opacity: 1; transform: translate(-50%, 0); }
.cookie-banner p { margin: 0; flex: 1; }
.cookie-banner strong { color: #fff; }
.cookie-banner a { color: #7dd3fc; text-decoration: underline; text-underline-offset: 2px; }
.cookie-icon { font-size: 24px; flex: none; }
.cookie-ok { flex: none; border: 0; cursor: pointer; background: #fff; color: #0f172a; font: inherit; font-weight: 700; padding: 10px 18px; border-radius: 10px; white-space: nowrap; }
.cookie-ok:hover { background: #e0f2fe; }
@media (max-width: 640px) { .cookie-banner { flex-wrap: wrap; bottom: 12px; } .cookie-icon { display: none; } .cookie-ok { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .cookie-banner { transition: none; } }
.cookie-banner[hidden] { display: none; }

/* ---------- v2.5 : finitions iPhone / Android ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
a, button, summary, label { -webkit-tap-highlight-color: rgba(56, 182, 255, .15); }
@supports (height: 100dvh) { .app, .guest { min-height: 100dvh; } }
@media (max-width: 760px) {
    .stat strong { font-size: 26px; white-space: nowrap; }
    .table td .select-status { max-width: 100%; width: auto; min-width: 0; text-overflow: ellipsis; }
    .table td:has(> .select-status), .table td:has(form .select-status) { min-width: 0; }
    .claim-cell { min-width: 0; justify-content: flex-end; }
    .btn, .icon-btn { touch-action: manipulation; }
}
.claim-assign select { color: var(--warn); font-weight: 600; max-width: 170px; }
.claim-assign.is-set select { color: var(--blue-ink); background-color: var(--blue-soft); border-color: transparent; }
.claim-time { font-size: 12px; color: var(--muted); white-space: nowrap; }


/* ==========================================================================
   v2.6 — Mode sombre
   Choix mémorisé (cookie DIRINA_THEME) ; sans choix, suit le réglage du téléphone / de l'ordinateur.
   ========================================================================== */
:root[data-theme="dark"] {
    --ink: #eceef2;
    --ink-2: #c4c8d0;
    --muted: #8d929d;
    --line: #2a2d35;
    --line-2: #22252b;
    --bg: #0e0f12;
    --white: #17191e;
    --blue-ink: #6ccaff;
    --blue-soft: #10283a;
    --ok: #4ade80;      --ok-soft: #10281a;
    --warn: #f2b65a;    --warn-soft: #2d2313;
    --danger: #f87171;  --danger-soft: #331719;
    --solid: #eceef2;   --on-solid: #0e0f12;
    --hover: #1c1f25;   --sunken: #121418;   --line-strong: #3a3e47;
    --danger-line: #5c2a2d; --warn-line: #5a4520; --doc-soft: #1b2242; --doc-ink: #9db0ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
    --ink: #eceef2;
    --ink-2: #c4c8d0;
    --muted: #8d929d;
    --line: #2a2d35;
    --line-2: #22252b;
    --bg: #0e0f12;
    --white: #17191e;
    --blue-ink: #6ccaff;
    --blue-soft: #10283a;
    --ok: #4ade80;      --ok-soft: #10281a;
    --warn: #f2b65a;    --warn-soft: #2d2313;
    --danger: #f87171;  --danger-soft: #331719;
    --solid: #eceef2;   --on-solid: #0e0f12;
    --hover: #1c1f25;   --sunken: #121418;   --line-strong: #3a3e47;
    --danger-line: #5c2a2d; --warn-line: #5a4520; --doc-soft: #1b2242; --doc-ink: #9db0ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
    }
}
:root[data-theme="dark"] .logo-mark g { fill: #fff; }
:root[data-theme="dark"] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d929d' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] .card-accent { background: linear-gradient(180deg, var(--blue-soft), var(--white) 70%); }
:root[data-theme="dark"] .composer-note textarea, .feed-note .feed-text { color: var(--ink); }
:root[data-theme="dark"] img.partner-logo, .doc-preview img { filter: none; }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .logo-mark g { fill: #fff; }
:root:not([data-theme="light"]) select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d929d' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
:root:not([data-theme="light"]) .card-accent { background: linear-gradient(180deg, var(--blue-soft), var(--white) 70%); }
:root:not([data-theme="light"]) .composer-note textarea, .feed-note .feed-text { color: var(--ink); }
:root:not([data-theme="light"]) img.partner-logo, .doc-preview img { filter: none; }
}
:root[data-theme="light"] { color-scheme: light; }

/* Interrupteur Clair / Sombre */
.theme-toggle { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--line-2); border: 1px solid var(--line); }
.theme-opt { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 9px; font: 600 12.5px var(--text); color: var(--muted); transition: background .15s, color .15s; }
.theme-opt:hover { color: var(--ink); }
.theme-opt[aria-pressed="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.theme-toggle-nav { margin: 8px 16px 14px; }
.theme-toggle-guest { position: absolute; top: 18px; right: 18px; width: 200px; }
.guest-panel { position: relative; }
body, .card, .sidebar, .stat, input, select, textarea { transition: background-color .2s ease, border-color .2s ease, color .2s ease; }

/* v2.9.1 : fil d'activité compact et repliable */
.feed-compact .feed-item { padding: 6px 0; gap: 10px; align-items: center; }
.feed-compact .feed-item.feed-note, .feed-compact .feed-item.feed-message { align-items: flex-start; }
.feed-compact .feed-icon { width: 24px; height: 24px; }
.feed-compact .feed-line { font-size: 13px; line-height: 1.45; }
.feed-compact .feed-day { margin: 12px 0 2px; font-size: 12px; }
.feed-what { color: var(--ink-2); }
.feed-sep { color: var(--muted); }
.feed-line .feed-task { font-size: 12.5px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
.feed-more { margin-top: 6px; }
.feed-more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--white); }
.feed-more > summary::-webkit-details-marker { display: none; }
.feed-more > summary:hover { border-color: var(--line-strong); color: var(--ink); }
.feed-more[open] > summary .ic { transform: rotate(180deg); }
.feed-more[open] > summary { margin-bottom: 4px; }
.cgu-accept { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; border: 2px solid var(--blue); }
.doc-foot a { white-space: nowrap; }
