:root {
    --oh-blue: #1c6fe3;
    --oh-blue-dark: #165fca;
    --oh-blue-050: #eef4fe;
    --oh-blue-100: #dbe8fc;
    --oh-green: #23a94c;
    --oh-indigo: #4f46e5;
    --oh-ink: #14243d;
    --oh-slate: #5b6675;
    --oh-slate-2: #6b7787;
    --oh-line: #e6eaef;
    --oh-bg: #f4f6f8;
    --oh-radius: 16px;
    --oh-radius-sm: 11px;
    --oh-grad-line: linear-gradient(90deg, var(--oh-blue), var(--oh-indigo), var(--oh-green));
    --oh-shadow-card: 0 1px 3px rgba(20, 36, 61, 0.05);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--oh-bg);
    color: var(--oh-ink);
    font-family: "Manrope", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: "Space Grotesk", "Manrope", sans-serif;
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: var(--oh-ink);
}

a { color: var(--oh-blue); }
a:hover { color: var(--oh-blue-dark); }

.site-top-header {
    background: #fff;
    border-bottom: 1px solid var(--oh-line);
    box-shadow: 0 2px 12px rgba(20, 36, 61, 0.05);
    position: relative;
}

.site-top-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--oh-grad-line);
}

.top-row, .site-top-header nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-top-header nav { padding-top: 0; padding-bottom: 0.85rem; justify-content: flex-start; }

.oh-brand {
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
    background: linear-gradient(90deg, #1c6fe3, #4f46e5, #23a94c, #1c6fe3);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.who { display: flex; align-items: center; gap: 0.75rem; color: var(--oh-slate); font-size: 0.875rem; }
.tenant-chip {
    background: var(--oh-bg);
    border: 1px solid var(--oh-line);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-weight: 600;
}

.nav-link {
    color: var(--oh-ink);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid transparent;
}
.nav-link:hover, .nav-link.is-current {
    background: var(--oh-blue-050);
    border-color: var(--oh-blue-100);
    color: var(--oh-blue-dark);
}

button, select {
    font-family: inherit;
}

.logout-btn, .btn, a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--oh-blue);
    border: 1px solid var(--oh-blue-100);
    border-radius: 999px;
    padding: 0.45rem 0.95rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
}
.logout-btn:hover, .btn:hover, a.btn:hover { background: var(--oh-blue-050); border-color: var(--oh-blue); color: var(--oh-blue-dark); }
a.btn-primary, button.btn-primary {
    background: var(--oh-blue);
    color: #fff;
    border-color: transparent;
    border-radius: var(--oh-radius-sm);
    box-shadow: 0 10px 22px rgba(28, 111, 227, 0.22);
}
a.btn-primary:hover, button.btn-primary:hover { background: var(--oh-blue-dark); color: #fff; }

.stack-form { display: grid; gap: 0.75rem; margin-top: 1rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; }
.stack-form label { display: grid; gap: 0.3rem; font-size: 0.8rem; font-weight: 700; color: var(--oh-slate); }
.stack-form input, .stack-form select, .stack-form textarea {
    border: 1px solid var(--oh-line);
    border-radius: var(--oh-radius-sm);
    padding: 0.5rem 0.7rem;
    font: inherit;
    color: var(--oh-ink);
    background: #fff;
}

main.app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 3rem;
}

.pipeline { display: flex; gap: 0.45rem; flex-wrap: wrap; margin: 0 0 1rem; }
.pipeline a {
    background: #fff;
    color: var(--oh-blue);
    border: 1px solid var(--oh-blue-100);
    border-radius: 999px;
    padding: 0.32rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}
.pipeline a:hover { background: var(--oh-blue-050); }

form.filters { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
form.filters label { display: grid; gap: 0.25rem; font-size: 0.8rem; font-weight: 600; color: var(--oh-slate); }
select {
    border: 1px solid #cfd6df;
    border-radius: var(--oh-radius-sm);
    padding: 0.45rem 0.6rem;
    background: #fff;
    color: var(--oh-ink);
}
button[type="submit"] {
    background: var(--oh-blue);
    color: #fff;
    border: 0;
    border-radius: var(--oh-radius-sm);
    padding: 0.5rem 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.table-wrap {
    background: #fff;
    border: 1px solid var(--oh-line);
    border-radius: var(--oh-radius);
    overflow: auto;
    box-shadow: var(--oh-shadow-card);
}
table { width: 100%; border-collapse: collapse; background: #fff; }
th {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--oh-slate-2);
    background: #f7f9fc;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--oh-line);
}
td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--oh-line); font-size: 0.875rem; }
tbody tr:hover { background: var(--oh-blue-050); }

.card, .empty {
    background: #fff;
    border: 1px solid var(--oh-line);
    border-radius: var(--oh-radius);
    box-shadow: var(--oh-shadow-card);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.muted { color: var(--oh-slate); }
.pager { display: flex; gap: 0.75rem; align-items: center; margin-top: 1rem; color: var(--oh-slate); font-size: 0.875rem; }

.guest {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}
.guest .oh-brand { display: inline-block; font-size: 1.6rem; margin: 0 0 0.75rem; }
.guest .card { width: min(32rem, 100%); position: relative; overflow: hidden; }
.guest .card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--oh-grad-line);
}
.error { color: #991b1b; }

/* En-tête : sur un téléphone, les blocs passent à la ligne au lieu de déborder. */
.top-row, .site-top-header nav, .who { flex-wrap: wrap; }
.who span { overflow-wrap: anywhere; }

/* Publications : états, calendrier, formulaires secondaires. */
.pipeline a.is-current { background: var(--oh-blue); border-color: var(--oh-blue); color: #fff; }
.state {
    display: inline-block;
    border: 1px solid var(--oh-line);
    border-radius: 999px;
    padding: 0.12rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    background: #f1f3f6;
    color: var(--oh-slate);
}
.state-idee { background: #fff6e0; border-color: #f1d28a; color: #7a5200; }
.state-approuve { background: var(--oh-blue-050); border-color: var(--oh-blue-100); color: var(--oh-blue-dark); }
.state-publie { background: #e8f6ed; border-color: #b9e2c7; color: #166534; }
.state-ecarte { background: #fff; color: var(--oh-slate-2); text-decoration: line-through; }
.notice { border-left: 4px solid var(--oh-green); }
.warning { border-left: 4px solid #d99a00; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-top: 0.75rem; }
button.btn-quiet[type="submit"] { background: #fff; color: var(--oh-blue); border: 1px solid var(--oh-blue-100); }
button.btn-quiet[type="submit"]:hover { background: var(--oh-blue-050); border-color: var(--oh-blue); }
details.more { margin-top: 0.75rem; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--oh-blue); }
fieldset.sources { border: 1px solid var(--oh-line); border-radius: var(--oh-radius-sm); padding: 0.75rem 1rem; display: grid; gap: 0.6rem; min-width: 0; }
fieldset.sources legend { font-size: 0.8rem; font-weight: 700; color: var(--oh-slate); padding: 0 0.3rem; }
fieldset.sources p { margin: 0; }
.stack-form input, .stack-form select, .stack-form textarea { width: 100%; min-width: 0; }
.stack-form label { min-width: 0; }

.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.cal-nav h2 { margin: 0; }
.cal {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: var(--oh-line);
    border: 1px solid var(--oh-line);
    border-radius: var(--oh-radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.cal-head { background: #f7f9fc; padding: 0.5rem 0.6rem; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--oh-slate-2); }
.cal-day { background: #fff; min-height: 7rem; padding: 0.4rem 0.5rem; min-width: 0; }
.cal-day.is-out { background: #fafbfc; }
.cal-day.is-out .cal-num { color: var(--oh-slate-2); font-weight: 400; }
.cal-num { font-size: 0.78rem; font-weight: 700; }
.cal-full { display: none; }
.cal-day.is-today .cal-num { background: var(--oh-blue); color: #fff; border-radius: 999px; padding: 0.05rem 0.45rem; }
.cal-item {
    display: block;
    margin-top: 0.35rem;
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--oh-line);
    border-radius: 8px;
    font-size: 0.75rem;
    line-height: 1.35;
    text-decoration: none;
    color: var(--oh-ink);
    overflow-wrap: anywhere;
}
.cal-item:hover { background: var(--oh-blue-050); border-color: var(--oh-blue-100); color: var(--oh-ink); }
.cal-item .state { font-size: 0.65rem; padding: 0.05rem 0.4rem; }

@media (max-width: 760px) {
    .cal { display: block; background: none; border: 0; border-radius: 0; }
    .cal-head, .cal-short, .cal-day.is-empty { display: none; }
    .cal-full { display: inline; }
    .cal-day { min-height: 0; border: 1px solid var(--oh-line); border-radius: var(--oh-radius-sm); margin-bottom: 0.5rem; padding: 0.6rem 0.75rem; }
}

/* Fiche 360° : en-tête, chemin de statut, trois zones. */
.fiche-head h1 { margin-bottom: 0.4rem; }
.state-statut { background: var(--oh-blue-050); border-color: var(--oh-blue-100); color: var(--oh-blue-dark); }
.state-hors, .state-retard { background: #fdecec; border-color: #f3b9b9; color: #991b1b; }
.alerte { border-left: 4px solid #d99a00; padding-left: 0.6rem; }
.path { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0.5rem 0; }
.path li { display: flex; align-items: center; }
.path li + li::before { content: "›"; color: var(--oh-slate-2); margin-right: 0.4rem; }
.path span, .path button {
    display: inline-block;
    border: 1px solid var(--oh-line);
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 700;
    background: #fff;
    color: var(--oh-slate);
}
.path .is-current span { background: var(--oh-blue); border-color: var(--oh-blue); color: #fff; }
.path .is-locked { background: #f1f3f6; color: var(--oh-slate-2); border-style: dashed; cursor: not-allowed; }
.path form { margin: 0; }
.fiche-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) minmax(0, 1.1fr);
    grid-template-areas: "left center right";
    gap: 1rem;
    align-items: start;
}
.zone { min-width: 0; }
.zone-left { grid-area: left; }
.zone-center { grid-area: center; }
.zone-right { grid-area: right; }
.zone .form-row { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.tl-item { padding: 0.6rem 0; border-bottom: 1px solid var(--oh-line); overflow-wrap: anywhere; }
.tl-item:last-child { border-bottom: 0; }
.tl-item p { margin: 0.15rem 0; }
.tl-item.is-late { border-left: 3px solid #c0392b; padding-left: 0.6rem; }
.tl-changes { margin: 0.2rem 0 0; padding-left: 1.1rem; }
.tl-close { margin-top: 0.35rem; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.3rem 0.9rem; margin: 0; overflow-wrap: anywhere; }
.facts dt { color: var(--oh-slate); font-size: 0.8rem; font-weight: 700; }
.facts dd { margin: 0; }

/* Écran étroit : en-tête, chemin, puis timeline, associations, identité. */
@media (max-width: 1000px) {
    .fiche-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "center" "right" "left"; }
}

form.filters label.check { display: flex; align-items: center; gap: 0.35rem; padding-bottom: 0.45rem; }

/* Tableau : colonnes au choix, cases à cocher, modification en masse. */
form.filters input[type="search"] { border: 1px solid #cfd6df; border-radius: var(--oh-radius-sm); padding: 0.45rem 0.6rem; font: inherit; min-width: 14rem; }
details.columns { margin-top: 0; align-self: end; padding-bottom: 0.45rem; }
.columns-list { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.4rem; }
th a { color: inherit; text-decoration: none; }
th a:hover { color: var(--oh-blue-dark); text-decoration: underline; }
.cell-check { width: 2.5rem; }
.bulk { margin-top: 1rem; }
.btn.is-disabled { color: var(--oh-slate-2); border-color: var(--oh-line); cursor: default; }
.btn.is-disabled:hover { background: #fff; border-color: var(--oh-line); color: var(--oh-slate-2); }

/* Console : la liste à gauche, la fiche du compte ouvert à droite. */
.console { display: grid; grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
.console-list {
    position: sticky;
    top: 0.75rem;
    max-height: calc(100vh - 1.5rem);
    overflow: auto;
    background: #fff;
    border: 1px solid var(--oh-line);
    border-radius: var(--oh-radius);
    box-shadow: var(--oh-shadow-card);
    padding: 0.5rem;
}
.console-list > p { margin: 0.4rem 0.5rem 0.6rem; font-size: 0.8rem; }
.console-line { display: grid; gap: 0.1rem; padding: 0.5rem 0.6rem; border-radius: var(--oh-radius-sm); text-decoration: none; color: var(--oh-ink); font-size: 0.875rem; overflow-wrap: anywhere; }
.console-line:hover { background: var(--oh-blue-050); color: var(--oh-ink); }
.console-line.is-current { background: var(--oh-blue-050); box-shadow: inset 3px 0 0 var(--oh-blue); }
.console-line .muted { font-size: 0.78rem; }
.console-pane { min-width: 0; }
.console-pane[aria-busy="true"] { opacity: 0.6; }
.console-nav { margin: 0 0 0.75rem; }
.console .fiche-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); grid-template-areas: "center right" "left right"; }

@media (max-width: 1000px) {
    .console { grid-template-columns: minmax(0, 1fr); }
    .console-list { position: static; max-height: 16rem; }
    .console .fiche-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "center" "right" "left"; }
}
details.columns summary { font-size: 0.8rem; }

/* Kanban : une colonne par statut, défilement horizontal dans le cadre. */
.kanban { display: flex; gap: 0.6rem; overflow-x: auto; align-items: flex-start; padding-bottom: 0.75rem; }
/* Le kanban prend toute la largeur de la fenêtre : dix colonnes y tiennent mieux. */
main.app:has([data-kanban]) { max-width: none; }
.kanban-col { flex: 1 0 10.5rem; background: #eef1f5; border: 1px solid var(--oh-line); border-radius: var(--oh-radius-sm); padding: 0.5rem; min-width: 0; min-height: 6rem; }
/* Opposition et Expiré, repliées : une colonne étroite tant qu'elle est fermée. */
.kanban-col.is-folded { flex: 0 0 8rem; }
.kanban-col.is-folded:has(details[open]) { flex: 1 0 10.5rem; }
.kanban-col h2, .kanban-col summary { display: flex; justify-content: space-between; align-items: center; gap: 0.4rem; margin: 0.1rem 0.2rem 0.5rem; font-size: 0.82rem; font-weight: 800; color: var(--oh-ink); }
.kanban-col summary { cursor: pointer; }
.kanban-count { background: #fff; border: 1px solid var(--oh-line); border-radius: 999px; padding: 0 0.5rem; font-size: 0.75rem; color: var(--oh-slate); }
.kanban-col.is-locked { background: #f6f7f9; border-style: dashed; }
.kanban-col.is-folded { background: #f6f7f9; }
.kanban-col.is-target { outline: 2px solid var(--oh-blue); background: var(--oh-blue-050); }
.kanban-card { background: #fff; border: 1px solid var(--oh-line); border-radius: 10px; padding: 0.5rem 0.6rem; margin-bottom: 0.45rem; font-size: 0.85rem; box-shadow: var(--oh-shadow-card); overflow-wrap: anywhere; }
.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card.is-dragged { opacity: 0.5; }
.kanban-card p { margin: 0.2rem 0 0; font-size: 0.78rem; }
.kanban-card a { text-decoration: none; }
.kanban-card a:hover { text-decoration: underline; }
.kanban-card .stack-form { margin-top: 0.4rem; gap: 0.4rem; }
.kanban-card details.more { margin-top: 0.3rem; }
.kanban-card details.more summary { font-size: 0.78rem; margin: 0; display: list-item; font-weight: 600; color: var(--oh-blue); }
.kanban-empty { margin: 0.4rem 0.2rem; font-size: 0.78rem; }
body:has([data-kanban]) .top-row, body:has([data-kanban]) .site-top-header nav { max-width: none; }

/* Qualification : brouillons et règles. */
.draft-body { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; background: #f7f9fc; border: 1px solid var(--oh-line); border-radius: var(--oh-radius-sm); padding: 0.75rem 0.9rem; }
.rule-form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.rule-form input[type="number"] { width: 5.5rem; border: 1px solid #cfd6df; border-radius: var(--oh-radius-sm); padding: 0.4rem 0.5rem; }
.rules-table code { white-space: nowrap; }
@media (max-width: 640px) {
  .rules-table thead { display: none; }
  .rules-table, .rules-table tbody, .rules-table tr, .rules-table td { display: block; width: 100%; }
  .rules-table tr { padding: 0.6rem 0; border-bottom: 1px solid #e3e8ef; }
  .rules-table td { border: 0; padding: 0.2rem 0.75rem; }
  .rules-table td[data-label]::before { content: attr(data-label) " : "; color: var(--oh-slate); }
}
.channel-connecte { background: #e8f6ed; border-color: #b9e2c7; color: #166534; }
.channel-en_erreur { background: #fdecec; border-color: #f3b9b9; color: #991b1b; }
.channel-deconnecte { background: #fff; color: var(--oh-slate-2); }
.channel-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 0.6rem; }
.guard-closed { border-left: 4px solid var(--oh-green); }
.guard-open { border-left: 4px solid #d97706; }
.consent-autorise { background: #e8f6ed; border-color: #b9e2c7; color: #166534; }
.consent-en_attente { background: #fff6e0; border-color: #f1d28a; color: #7a5200; }
.consent-desabonne, .consent-non_delivrable { background: #fff; color: var(--oh-slate-2); }
.consent-plainte { background: #fdecec; border-color: #f3b9b9; color: #991b1b; }
.consent-inconnu { background: #fff; color: var(--oh-slate); }
.erase-form { border-top: 1px solid #f3b9b9; padding-top: 0.6rem; margin-top: 0.6rem; }
.proof-link { font-size: 0.82rem; }
.proof-form { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.proof-form label.check { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 400; }
.proof-form .actions { flex-basis: 100%; }
.tl-item:target { outline: 2px solid var(--oh-blue-100); border-radius: var(--oh-radius-sm); }
.token-value { display: inline-block; padding: 0.4rem 0.6rem; background: var(--oh-blue-050); border-radius: var(--oh-radius-sm); word-break: break-all; user-select: all; }

/* Tableau de bord */
.dash-head h1 { margin-bottom: 0.2rem; }
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.8rem; margin: 1rem 0 1.2rem; }
.stat { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.9rem 1rem; background: #fff; border: 1px solid #e3e8ef; border-radius: var(--oh-radius-sm); text-decoration: none; color: inherit; }
.stat:hover { border-color: var(--oh-blue-100); }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-label { font-weight: 600; font-size: 0.9rem; }
.stat-note { color: var(--oh-slate); font-size: 0.8rem; }
.stat-alert { border-left: 4px solid #d97706; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 1rem; align-items: start; }
.dash-grid > * { min-width: 0; }
.dash-wide { grid-column: 1 / -1; }
.dash-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 1rem; }
.dash-split > * { min-width: 0; }
.dash-grid .card { margin: 0; }
.dash-line { margin: 0.35rem 0; }
.bars { display: flex; flex-direction: column; gap: 0.3rem; }
.bar-row { display: grid; grid-template-columns: 7.5rem 1fr 2.5rem; align-items: center; gap: 0.5rem; text-decoration: none; color: inherit; font-size: 0.88rem; }
.bar-track { height: 0.6rem; background: var(--oh-blue-050); border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--oh-blue); border-radius: 4px; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; }
.bar-row:hover .bar-label { text-decoration: underline; }
.dash-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-table tr.total td { font-weight: 600; }
@media (max-width: 640px) { .bar-row { grid-template-columns: 6.5rem 1fr 2rem; } }
.company-result tr.differs td { background: #fff6e0; }
.dirigeants { border: 1px solid #e3e8ef; border-radius: var(--oh-radius-sm); padding: 0.6rem 0.8rem; display: flex; flex-direction: column; gap: 0.3rem; }
.dirigeants legend { font-weight: 600; font-size: 0.9rem; padding: 0 0.3rem; }
.dirigeants label.check { display: flex; gap: 0.4rem; align-items: center; font-weight: 400; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 1rem; }
.settings-grid label { display: flex; flex-direction: column; gap: 0.3rem; }
.settings-grid .muted { font-weight: 400; font-size: 0.8rem; }
.ia-result { border-left: 4px solid var(--oh-blue-100); padding: 0.4rem 0.8rem; margin: 0.6rem 0; background: var(--oh-blue-050); border-radius: var(--oh-radius-sm); }
.meeting-line { display: flex; flex-wrap: wrap; gap: 0.3rem 0.5rem; align-items: baseline; padding: 0.45rem 0; border-bottom: 1px solid #eef1f5; }
.meeting-line:last-child { border-bottom: 0; }
.meeting-time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 6.5rem; }
.meeting-where { margin-left: auto; }
.meeting-day { margin: 0.6rem 0 0; font-size: 0.82rem; }
.meeting-physique { background: #e8f6ed; border-color: #b9e2c7; color: #166534; }
.meeting-telephone { background: #fff6e0; border-color: #f1d28a; color: #7a5200; }
.meeting-zoom, .meeting-teams, .meeting-kmeet, .meeting-meet, .meeting-visio { background: var(--oh-blue-050); border-color: var(--oh-blue-100); color: var(--oh-blue-dark); }
.stack-form label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.9rem; }
.stack-form label.check input { width: auto; flex: none; margin: 0; }

/* Recherche globale (Ctrl+K) et raccourcis */
.kbd { display: inline-block; padding: 0.05rem 0.35rem; border: 1px solid var(--oh-line); border-bottom-width: 2px; border-radius: 5px; background: #fff; font: 600 0.72rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--oh-slate); vertical-align: middle; }
h2 .kbd, summary .kbd { margin-left: 0.35rem; font-size: 0.68rem; }
.top-search { position: relative; flex: 1 1 14rem; max-width: 22rem; margin: 0 1rem; }
.top-search input { width: 100%; padding: 0.45rem 4.2rem 0.45rem 0.75rem; border: 1px solid var(--oh-line); border-radius: 999px; background: var(--oh-bg); font: inherit; font-size: 0.85rem; }
.top-search .kbd { position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%); pointer-events: none; }
dialog.palette { width: min(40rem, calc(100vw - 2rem)); max-height: min(32rem, calc(100vh - 4rem)); margin: 8vh auto auto; padding: 0; border: 1px solid var(--oh-line); border-radius: var(--oh-radius); box-shadow: 0 20px 50px rgba(20, 36, 61, 0.25); color: var(--oh-ink); overflow: hidden; }
dialog.palette[open] { display: flex; flex-direction: column; }
dialog.palette::backdrop { background: rgba(20, 36, 61, 0.35); }
.palette input[data-palette-input] { border: 0; border-bottom: 1px solid var(--oh-line); padding: 1rem 1.1rem; font: inherit; font-size: 1.05rem; outline: none; }
.palette ul { list-style: none; margin: 0; padding: 0.4rem; overflow-y: auto; flex: 1 1 auto; }
.palette li a { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0 0.6rem; padding: 0.55rem 0.7rem; border-radius: var(--oh-radius-sm); color: var(--oh-ink); text-decoration: none; }
.palette li.is-active a, .palette li a:hover { background: var(--oh-blue-050); }
.palette-type { grid-row: span 2; align-self: center; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--oh-slate-2); }
.palette-detail { font-size: 0.8rem; color: var(--oh-slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-empty { padding: 1rem; color: var(--oh-slate); }
.palette-help { margin: 0; padding: 0.55rem 1rem; border-top: 1px solid var(--oh-line); font-size: 0.75rem; color: var(--oh-slate); }
dialog.raccourcis { padding: 1.25rem 1.5rem; display: block; }
dialog.raccourcis:not([open]) { display: none; }
.raccourcis h3 { margin: 1rem 0 0.4rem; font-size: 0.9rem; }
.raccourcis dl { display: grid; grid-template-columns: auto 1fr; gap: 0.45rem 1rem; margin: 0; }
.raccourcis dd { margin: 0; }
@media (max-width: 640px) {
    .top-search { order: 3; flex-basis: 100%; max-width: none; margin: 0.5rem 0 0; }
    .top-search .kbd { display: none; }
    .palette li a { grid-template-columns: 1fr; }
    .palette-type { grid-row: auto; }
}
.raccourcis form { margin-top: 1rem; }

/* Historique compact */
h2 .count { display: inline-block; min-width: 1.5rem; margin-left: 0.3rem; padding: 0 0.4rem; border-radius: 999px; background: var(--oh-blue-050); color: var(--oh-blue); font-size: 0.75rem; text-align: center; vertical-align: middle; }
h2 .state { margin-left: 0.3rem; font-size: 0.72rem; vertical-align: middle; }
.tl-group { margin: 0.9rem 0 0.2rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--oh-slate-2); }
.tl-group:first-of-type { margin-top: 0.3rem; }
.tl-group-retard { color: #991b1b; }
.tl-line { border-bottom: 1px solid var(--oh-line); }
.tl-line:last-child { border-bottom: 0; }
.tl-line > summary { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 0.6rem; align-items: baseline; padding: 0.4rem 0.2rem; cursor: pointer; list-style: none; }
.tl-line > summary::-webkit-details-marker { display: none; }
.tl-line > summary:hover { background: var(--oh-blue-050); border-radius: 8px; }
.tl-line[open] > summary { font-weight: 600; }
.tl-type { font-size: 0.72rem; font-weight: 700; color: var(--oh-slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-sujet { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }
.tl-line[open] .tl-sujet { white-space: normal; }
.tl-date { font-size: 0.75rem; color: var(--oh-slate-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-detail { padding: 0 0.2rem 0.6rem 7.1rem; font-size: 0.82rem; overflow-wrap: anywhere; }
.tl-detail p { margin: 0.15rem 0; }
.tl-line:target > summary { outline: 2px solid var(--oh-blue-100); border-radius: 8px; }
.tl-type-reunion, .tl-type-appel { color: var(--oh-blue); }
.tl-type-qualification, .tl-type-archivage { color: var(--oh-indigo); }
.tl-type-lead { color: var(--oh-green); }
@media (max-width: 640px) {
    .tl-line > summary { grid-template-columns: 1fr auto; }
    .tl-type { grid-column: 1 / -1; }
    .tl-detail { padding-left: 0.2rem; }
}

/* Saisie rapide (pensée pour le téléphone) */
.quick { max-width: 40rem; margin: 0 auto; }
.quick-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.quick-form legend { font-size: 0.8rem; font-weight: 700; color: var(--oh-slate); margin-bottom: 0.35rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chips legend { width: 100%; }
.stack-form .chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.6rem 0.95rem; border: 1px solid var(--oh-line); border-radius: 999px; background: #fff; font-size: 0.95rem; font-weight: 600; color: var(--oh-ink); cursor: pointer; min-height: 44px; }
.stack-form .chip input { width: auto; margin: 0; accent-color: var(--oh-blue); }
.stack-form .chip:has(input:checked) { border-color: var(--oh-blue); background: var(--oh-blue-050); color: var(--oh-blue-dark); }
.quick-form textarea { font-size: 1rem; }
.quick-submit .btn-primary { width: 100%; min-height: 48px; font-size: 1rem; }
.tl-quick { margin: 0.2rem 0 0; font-size: 0.85rem; }
@media (max-width: 640px) {
    .quick-submit { position: sticky; bottom: 0; padding: 0.6rem 0; background: linear-gradient(transparent, var(--oh-bg) 30%); }
}
.quick-form [hidden] { display: none !important; }

/* Vues enregistrées */
.saved-views { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0.5rem 0 0.75rem; font-size: 0.85rem; }
.saved-view { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.3rem 0.2rem 0.7rem; border: 1px solid var(--oh-line); border-radius: 999px; background: #fff; }
.saved-view.is-current { border-color: var(--oh-blue); background: var(--oh-blue-050); }
.saved-view a { font-weight: 600; text-decoration: none; }
.saved-view form { display: inline; margin: 0; }
.saved-view-tag { font-size: 0.68rem; font-weight: 700; color: var(--oh-green); text-transform: uppercase; letter-spacing: 0.03em; }
.saved-view-del { border: 0; background: none; color: var(--oh-slate-2); font-size: 1rem; line-height: 1; padding: 0 0.3rem; cursor: pointer; }
.saved-view-del:hover { color: #991b1b; }
.saved-view-new { flex-basis: 100%; }
.saved-view-new[open] { padding-bottom: 0.25rem; }
.saved-views button.saved-view-del { background: none; border: 0; box-shadow: none; min-height: 0; width: auto; padding: 0 0.35rem; color: var(--oh-slate-2); font-size: 1.05rem; }
.saved-views button.saved-view-del:hover { background: #fdecec; color: #991b1b; border-radius: 999px; }

/* Cartes du kanban : montant, prochaine action, compte qui dort */
.kanban-sum { margin: -0.3rem 0.2rem 0.5rem; font-size: 0.75rem; }
.kanban-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.kanban-lettre { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; border-radius: 6px; background: #eef1f5; font-size: 0.7rem; font-weight: 800; color: var(--oh-slate); }
.kanban-lettre-A { background: #e3f5ea; color: #16723a; }
.kanban-lettre-B { background: var(--oh-blue-050); color: var(--oh-blue-dark); }
.kanban-montant { margin-left: auto; font-weight: 700; color: var(--oh-ink); font-variant-numeric: tabular-nums; }
.kanban-next { color: var(--oh-slate); }
.kanban-next time { font-weight: 700; margin-right: 0.2rem; }
.kanban-next.is-late, .kanban-next.is-late time { color: #991b1b; }
.state-dort { background: #fff6e0; border-color: #f2d48a; color: #8a5a00; }
