/* ===== Thème ===== */
:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --text: #1b2430;
  --muted: #5f6b7c;
  --line: #e2e7ee;
  --line-strong: #cbd3de;
  --brand: #0f5fa8;
  --brand-600: #0b4c88;
  --brand-50: #e7f0fa;
  --ok: #17794a;
  --ok-bg: #e4f5ec;
  --warn: #9a5b00;
  --warn-bg: #fff3dc;
  --danger: #b3261e;
  --danger-bg: #fdeceb;
  --info-bg: #e7f0fa;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.18);
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b;
    --panel: #171e27;
    --panel-2: #1c2530;
    --text: #e6ebf2;
    --muted: #9aa6b6;
    --line: #2a3441;
    --line-strong: #3a4757;
    --brand: #5aa6ee;
    --brand-600: #8bc0f5;
    --brand-50: #172a40;
    --ok: #55c58a;
    --ok-bg: #12301f;
    --warn: #f0b04a;
    --warn-bg: #352712;
    --danger: #ff8a80;
    --danger-bg: #3a1a18;
    --info-bg: #172a40;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 15px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.6em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex: none; vertical-align: -3px; }

/* ===== Structure ===== */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px; background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 700; font-size: 1.05rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 0.75rem; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); font-weight: 500; }
.nav a:hover { background: var(--panel-2); text-decoration: none; }
.nav a.active { background: var(--brand-50); color: var(--brand-600); }
.nav .count { margin-left: auto; background: var(--warn-bg); color: var(--warn); border-radius: 999px; font-size: 0.75rem; padding: 1px 8px; font-weight: 700; }
.scope-note { margin-top: auto; font-size: 0.8rem; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.scope-note strong { color: var(--text); }
.content { min-width: 0; }
.topbar { display: none; }
.main { padding: 26px 34px 70px; max-width: 1320px; }
.main:focus { outline: none; }
.scrim { display: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1:focus { outline: none; }
.page-head p { margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 920px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 40; transform: translateX(-102%); transition: transform 0.2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 30; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .main { padding: 18px 16px 60px; }
}

/* ===== Cartes, grilles ===== */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cols-main { display: grid; gap: 18px; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
@media (max-width: 1100px) { .cols-main { grid-template-columns: minmax(0, 1fr); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* ===== Boutons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; transition: background 0.12s, border-color 0.12s; }
.btn:hover { text-decoration: none; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not([disabled]) { background: var(--brand-600); }
@media (prefers-color-scheme: dark) { .btn-primary { color: #0b1620; } .btn-primary:hover:not([disabled]) { color: #0b1620; } }
.btn-secondary { background: var(--panel); border-color: var(--line-strong); color: var(--text); }
.btn-secondary:hover:not([disabled]) { background: var(--panel-2); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover:not([disabled]) { background: var(--brand-50); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-danger-ghost:hover:not([disabled]) { background: var(--danger-bg); }
.btn-sm { padding: 5px 10px; font-size: 0.87rem; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn.is-on { color: #d99a00; }

/* ===== Formulaires ===== */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .combo > label, .label { font-weight: 600; font-size: 0.88rem; }
.hint { color: var(--muted); font-size: 0.82rem; }
.input, .select, .textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; }
.input:focus, .select:focus, .textarea:focus { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); border-color: var(--brand); }
.textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.textarea.tall { min-height: 360px; }
.textarea.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.88rem; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 680px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: none; background: var(--panel); color: var(--text); padding: 6px 12px; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .seg button[aria-pressed="true"] { color: #0b1620; } }

/* ===== Badges et puces ===== */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge-info { background: var(--info-bg); color: var(--brand-600); border-color: transparent; }
.badge-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.st-a_envoyer { background: var(--panel-2); color: var(--muted); }
.st-envoyee { background: #e3effd; color: #0b4c88; border-color: transparent; }
.st-relancee { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.st-reponse { background: #dff4f2; color: #0a6b63; border-color: transparent; }
.st-entretien { background: #ece6fb; color: #5b34b0; border-color: transparent; }
.st-offre, .st-acceptee { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.st-refusee { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.st-sans_reponse, .st-retiree { background: var(--panel-2); color: var(--muted); }
@media (prefers-color-scheme: dark) {
  .st-envoyee { background: #173456; color: #8bc0f5; }
  .st-reponse { background: #11332f; color: #6fd3c8; }
  .st-entretien { background: #2a2147; color: #b9a2f5; }
}
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-50); color: var(--brand-600); border-radius: 999px; padding: 3px 6px 3px 11px; font-size: 0.85rem; font-weight: 500; }
.chip-remove { display: inline-grid; place-items: center; width: 18px; height: 18px; border: none; background: transparent; color: inherit; border-radius: 50%; cursor: pointer; padding: 0; }
.chip-remove:hover { background: color-mix(in srgb, var(--brand) 20%, transparent); }
.chip-static { background: var(--panel-2); color: var(--text); padding: 3px 11px; border: 1px solid var(--line); }
.chip-toggle { border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 0.87rem; cursor: pointer; }
.chip-toggle:hover { border-color: var(--brand); }
.chip-toggle[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .chip-toggle[aria-pressed="true"] { color: #0b1620; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ===== Liste déroulante multi-choix ===== */
.combo { position: relative; display: flex; flex-direction: column; gap: 5px; }
.combo-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); min-height: 40px; }
.combo-box:focus-within { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); border-color: var(--brand); }
.combo-input { flex: 1; min-width: 140px; border: none; outline: none; background: transparent; color: var(--text); font: inherit; padding: 4px 2px; }
.combo-list { position: absolute; z-index: 30; top: 100%; left: 0; right: 0; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; }
.combo-option { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.combo-option.is-active { background: var(--brand-50); }
.combo-empty { padding: 10px; color: var(--muted); }

/* ===== Onglets ===== */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border: none; background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--brand-600); border-bottom-color: var(--brand); }

/* ===== Modale ===== */
dialog.modal { border: none; padding: 0; background: transparent; max-width: min(560px, calc(100vw - 24px)); width: 100%; color: var(--text); }
dialog.modal.modal-wide { max-width: min(860px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(10, 16, 24, 0.55); }
.modal-box { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 8px; }
.modal-body { padding: 6px 18px 16px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 14px 14px; }

/* ===== Notifications ===== */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 11px 12px 11px 14px; border-radius: 10px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); }
.toast-success { background: var(--ok); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast .icon-btn { color: inherit; opacity: 0.8; width: 24px; height: 24px; }
.toast .icon-btn:hover { background: rgba(255, 255, 255, 0.18); }

/* ===== Bandeaux, états ===== */
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; background: var(--info-bg); color: var(--text); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); margin-bottom: 14px; }
.banner > .icon { margin-top: 2px; color: var(--brand); }
.banner-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.banner-warn > .icon { color: var(--warn); }
.banner-danger { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.banner-danger > .icon { color: var(--danger); }
.banner-ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.banner-ok > .icon { color: var(--ok); }
.banner ul { margin: 4px 0 0; padding-left: 18px; }
.loading { display: flex; align-items: center; gap: 10px; padding: 28px; color: var(--muted); justify-content: center; }
.spinner { width: 18px; height: 18px; border: 3px solid var(--line-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } html { scroll-behavior: auto; } }
.empty { text-align: center; padding: 38px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); margin-bottom: 6px; }
.boot-error { max-width: 520px; margin: 18vh auto; text-align: center; padding: 0 20px; }

/* ===== Connexion (mode hébergé) ===== */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(400px, 100%); text-align: left; }
.form-error { color: var(--danger); font-size: 0.9rem; }

/* ===== Veille d'offres ===== */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters .input[type="search"] { flex: 1 1 220px; }
.filters select.input { flex: 0 1 auto; width: auto; }
.offer-desc { white-space: pre-line; }
.muted-card { opacity: 0.65; }
.picker-list { list-style: none; margin: 6px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.picker-item { display: flex; gap: 8px; width: 100%; border: none; background: var(--panel); color: var(--text); padding: 8px 12px; font: inherit; cursor: pointer; text-align: left; }
.picker-item:hover { background: var(--brand-50); }
.picker-list li + li .picker-item { border-top: 1px solid var(--line); }

/* ===== Tableaux ===== */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); font-weight: 700; background: var(--panel-2); }
.table th button { all: unset; cursor: pointer; font: inherit; text-transform: inherit; letter-spacing: inherit; font-weight: inherit; color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.table tr:hover td { background: var(--panel-2); }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.name-cell { min-width: 200px; }
.table th.select-cell, .table td.select-cell { width: 38px; padding-right: 0; }

/* ===== Tableau de bord ===== */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .value { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.kpi .label { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.kpi .sub { font-size: 0.8rem; color: var(--muted); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.steps .num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); font-weight: 700; flex: none; }
.steps li.done .num { background: var(--ok); color: #fff; }
.steps li.done .step-title { text-decoration: line-through; color: var(--muted); }
.step-title { font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: none; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding-top: 8px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; font-size: 0.78rem; color: var(--muted); }
.bar-fill { width: 100%; max-width: 38px; background: var(--brand); border-radius: 6px 6px 0 0; min-height: 3px; opacity: 0.85; }
.bar-count { font-weight: 700; color: var(--text); }

/* ===== Recherche ===== */
.search-card .form-grid { align-items: start; }
.sector-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.result { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px 4px; border-bottom: 1px solid var(--line); }
.result:last-child { border-bottom: none; }
.result h3 { font-size: 1.05rem; margin-bottom: 6px; }
.result-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 0.88rem; margin-top: 8px; }
.result-meta span { display: inline-flex; align-items: center; gap: 5px; }
.result-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
@media (min-width: 1360px) { .result { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } .result-actions { justify-content: flex-end; } }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding-top: 16px; }
.select-box { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--brand); flex: none; }
.bulkbar { position: sticky; bottom: 14px; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 10px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--brand); box-shadow: var(--shadow-lg); }

/* ===== Fiche entreprise ===== */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 20px; margin: 0; }
.facts dt { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 700; }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.link-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.estab { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; }
.estab.is-selected { border-color: var(--brand); background: var(--brand-50); }

/* ===== Tableau de suivi (kanban) ===== */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.column { background: color-mix(in srgb, var(--line) 35%, var(--bg)); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 160px; transition: background 0.12s, border-color 0.12s; }
.column.drop-active { border-color: var(--brand); background: var(--brand-50); }
.column-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; font-weight: 700; }
.column-head .n { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 0 9px; font-size: 0.8rem; color: var(--muted); }
.app-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 9px; box-shadow: var(--shadow); cursor: grab; }
.app-card:active { cursor: grabbing; }
.app-card.dragging { opacity: 0.45; }
.app-card h3 { font-size: 0.97rem; margin-bottom: 2px; }
.app-card h3 a { color: var(--text); }
.app-card .meta { color: var(--muted); font-size: 0.83rem; display: flex; flex-direction: column; gap: 2px; margin: 4px 0 8px; }
.app-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.app-card .select { padding: 4px 6px; font-size: 0.82rem; width: auto; }
.col-empty { color: var(--muted); font-size: 0.85rem; text-align: center; padding: 14px 6px; border: 1px dashed var(--line-strong); border-radius: 10px; }

/* ===== Chronologie ===== */
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 18px 26px; border-left: 2px solid var(--line); margin-left: 8px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline .dot { position: absolute; left: -9px; top: 1px; width: 16px; height: 16px; border-radius: 50%; background: var(--panel); border: 3px solid var(--brand); }
.timeline .dot.st-envoyee, .timeline .dot.st-relancee { border-color: #d99a00; }
.timeline .dot.ok { border-color: var(--ok); }
.timeline .dot.bad { border-color: var(--danger); }
.timeline .dot.neutral { border-color: var(--line-strong); }
.timeline .when { color: var(--muted); font-size: 0.82rem; }
.timeline .what { font-weight: 600; }
.timeline .detail { color: var(--muted); white-space: pre-wrap; margin-top: 2px; }

/* ===== Documents ===== */
.dropzone { border: 2px dashed var(--line-strong); border-radius: 12px; padding: 26px 16px; text-align: center; background: var(--panel-2); transition: border-color 0.12s, background 0.12s; }
.dropzone.is-over { border-color: var(--brand); background: var(--brand-50); }
.dropzone input { display: none; }
.doc-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--panel); }
.doc-card.is-default { border-color: var(--brand); }
.letter-editor { font-family: Georgia, "Times New Roman", serif; font-size: 1rem; line-height: 1.6; }
.preview-frame { width: 100%; height: 720px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.section-editor { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel-2); }
code.var { background: var(--brand-50); color: var(--brand-600); padding: 1px 6px; border-radius: 6px; font-size: 0.85em; }
.var-btn { border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); border-radius: 6px; padding: 3px 8px; font: 0.82rem ui-monospace, Consolas, monospace; cursor: pointer; }
.var-btn:hover { border-color: var(--brand); color: var(--brand-600); }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: none; }
.flip { transform: rotate(180deg); }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; display: inline-block; margin-right: 6px; transition: transform 0.12s; }
details[open] > summary::before { transform: rotate(90deg); }
fieldset legend { padding: 0; }
