/* SCAE Courtage – feuille de style principale (aucune dépendance externe) */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --primary: #1d4ed8;
  --primary-soft: #dbeafe;
  --success: #15803d;
  --success-soft: #dcfce7;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --info: #0e7490;
  --info-soft: #cffafe;
  --sidebar-bg: #0f172a;
  --sidebar-text: #cbd5e1;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120; --surface: #111827; --surface-2: #0f172a; --border: #1f2937;
    --text: #e5e7eb; --text-muted: #94a3b8; --primary: #60a5fa; --primary-soft: #1e3a8a;
    --success: #4ade80; --success-soft: #14532d; --warning: #fbbf24; --warning-soft: #78350f;
    --danger: #f87171; --danger-soft: #7f1d1d; --info: #22d3ee; --info-soft: #164e63;
    --sidebar-bg: #020617;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.45; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.muted, .text-muted { color: var(--text-muted); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.hidden { display: none !important; }

/* Mise en page */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; flex-shrink: 0; background: var(--sidebar-bg); color: var(--sidebar-text); padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 16px; padding: 4px 8px 14px; }
.brand:hover { text-decoration: none; }
.brand-logo { background: #fff; width: 40px; height: 40px; border-radius: 8px; padding: 4px; object-fit: contain; flex-shrink: 0; }
.brand-texte { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-texte small { font-size: 11px; font-weight: 500; color: var(--sidebar-text); }
.login-logo { display: block; margin: 0 auto 10px; height: 110px; width: auto; background: #fff; border-radius: 8px; padding: 6px; }
.login-card .login-cabinet { text-align: center; color: var(--text-muted); font-size: 13px; margin: -8px 0 16px; }
.global-search input { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid #334155; background: #1e293b; color: #fff; margin-bottom: 10px; }
.nav-section summary { cursor: pointer; padding: 8px; border-radius: 6px; font-weight: 600; color: #e2e8f0; list-style: none; display: flex; gap: 8px; align-items: center; }
.nav-section summary::-webkit-details-marker { display: none; }
.nav-section summary:hover { background: #1e293b; }
.nav-section ul { list-style: none; margin: 0 0 6px; padding: 0 0 0 30px; }
.nav-link { display: block; padding: 5px 8px; color: var(--sidebar-text); border-radius: 6px; font-size: 13px; }
.nav-link:hover, .nav-link.active { background: #1e293b; color: #fff; text-decoration: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-right { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.breadcrumbs { color: var(--text-muted); font-size: 13px; }
.menu-toggle { display: none; }
.content { padding: 22px 24px 60px; max-width: 1500px; width: 100%; }
.content-anon { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.user { font-weight: 600; }
.link-muted { color: var(--text-muted); background: none; border: 0; cursor: pointer; font: inherit; padding: 0; }

/* En-tête de page */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-header .subtitle { color: var(--text-muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Cartes et grilles */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; }
.card-header h2, .card-header h3 { margin: 0; }
.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-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-main-side { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -280px; z-index: 50; transition: left .2s; }
  .sidebar.open { left: 0; }
  .menu-toggle { display: inline-block; }
  .content { padding: 16px; }
  .topbar { padding: 10px 16px; }
  .user, .masque-mobile, .topbar .breadcrumbs { display: none; }
  .topbar-right { gap: 8px; }
}

/* Indicateurs */
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi-label { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.kpi.warn .kpi-value { color: var(--warning); }
.kpi.danger .kpi-value { color: var(--danger); }
.kpi.success .kpi-value { color: var(--success); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:hover { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; background: var(--surface-2); }
.table .row-link { cursor: pointer; }
.empty { text-align: center; color: var(--text-muted); padding: 24px; }

/* Fiche détail */
dl.fields { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 6px 14px; margin: 0; }
dl.fields dt { color: var(--text-muted); }
dl.fields dd { margin: 0; font-weight: 500; word-break: break-word; }
dl.fields.fields-empiles { grid-template-columns: 1fr; gap: 2px; }
dl.fields.fields-empiles dd { margin-bottom: 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 8px 10px; font-size: 13px; border: 0; background: none; cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; font: inherit; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0 8px 16px; border-left: 2px solid var(--border); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.timeline .date { color: var(--text-muted); font-size: 12px; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.badge-en_cours, .badge-payee, .badge-client, .badge-gagne, .badge-encaisse, .badge-valide, .badge-regle, .badge-paye, .badge-reverse, .badge-percue, .badge-fait, .badge-realisee, .badge-accepte, .badge-transforme, .badge-rapproche, .badge-obtenu, .badge-delivre, .badge-lu { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-emise, .badge-prospect, .badge-nouveau, .badge-declare, .badge-saisi, .badge-brouillon, .badge-a_faire, .badge-planifiee, .badge-importe, .badge-a_reverser, .badge-a_percevoir, .badge-transmis, .badge-envoye, .badge-planifie { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge-partielle, .badge-warning, .badge-suspendue, .badge-expertise, .badge-attente_pieces, .badge-instruction, .badge-negociation, .badge-proposition, .badge-cotation, .badge-qualifie, .badge-remis, .badge-extrait, .badge-en_cours.badge-warn, .badge-offre, .badge-offres_recues, .badge-propose, .badge-moyen, .badge-haute, .badge-doublon, .badge-a_payer, .badge-a_envoyer { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-impayee, .badge-resiliee, .badge-perdu, .badge-rejete, .badge-erreur, .badge-contentieux, .badge-bloque, .badge-eleve, .badge-urgente, .badge-annulee, .badge-sans_effet, .badge-refuse, .badge-echec { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-expiree, .badge-ancien, .badge-clos, .badge-annule, .badge-remplacee, .badge-non_applicable, .badge-simule { background: var(--surface-2); color: var(--text-muted); }

/* Boutons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); background: var(--primary); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 3px 9px; font-size: 12px; }
.btn-icon { background: none; border: 0; font-size: 18px; cursor: pointer; color: inherit; }
.pill { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 13px; }
.pill-warn { background: var(--warning-soft); color: var(--warning); }

/* Formulaires */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } }
.form-row { display: flex; flex-direction: column; gap: 4px; }
.form-row.full { grid-column: 1 / -1; }
.form-row label { font-weight: 600; font-size: 13px; }
.form-row .help { color: var(--text-muted); font-size: 12px; }
.form-row .errorlist { color: var(--danger); margin: 0; padding: 0; list-style: none; font-size: 12px; }
.input, .select, input[type=text], input[type=search], input[type=number], input[type=date], input[type=email], input[type=password], select, textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit;
}
textarea { resize: vertical; }
.input:focus, .select:focus, input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.checkbox { width: auto; }
.form-actions { display: flex; gap: 8px; margin-top: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.filters .input, .filters .select, .filters input, .filters select { width: auto; min-width: 160px; }
.field-low { background: var(--warning-soft) !important; }
.field-completed { background: var(--info-soft) !important; }

/* Alertes */
.filters .btn-filtres { display: none; }
.filters .filtres-plus { display: contents; }
.messages { margin-bottom: 14px; position: sticky; top: 64px; z-index: 15; }
.messages .alert { box-shadow: 0 2px 8px rgba(0, 0, 0, .08); position: relative; padding-right: 34px; }
.messages .fermer { position: absolute; right: 8px; top: 6px; border: 0; background: none; cursor: pointer; font-size: 18px; color: inherit; opacity: .6; }
@media print { .messages { display: none; } }
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; border: 1px solid transparent; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error, .alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-info { background: var(--info-soft); color: var(--info); }

/* Pipeline (kanban) */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.kanban-col h3 { display: flex; justify-content: space-between; font-size: 13px; text-transform: uppercase; color: var(--text-muted); }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow); }
.kanban-card .title { font-weight: 600; }

/* Barres simples (graphiques sans librairie) */
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 150px; gap: 8px; align-items: center; font-size: 13px; }
.bar-track { background: var(--surface-2); border-radius: 4px; height: 12px; overflow: hidden; }
.bar-fill { background: var(--primary); height: 100%; border-radius: 4px; }
.pagination { display: flex; gap: 6px; align-items: center; margin-top: 12px; }

/* Connexion */
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { text-align: center; margin-bottom: 16px; }

/* Impression */
@media print {
  .sidebar, .topbar, .actions, .no-print, .filters { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 0; }
  body { background: #fff; }
  /* Écrans imprimés tels quels (état des impayés, listes…) : tout le tableau sur la page, pas de défilement */
  .main, .content { margin: 0 !important; width: auto !important; }
  .table-wrap { overflow: visible !important; }
  table.table { font-size: 10px; }
  .table th, .table td { padding: 3px 4px; white-space: normal; }
  .table th { letter-spacing: 0; }
  .btn { display: none !important; }
}

/* Graphiques (barres CSS, une seule série par graphique, survol = valeur) */
:root { --series-1: #2a78d6; --chart-grid: #e7e5e4; }
@media (prefers-color-scheme: dark) { :root { --series-1: #3987e5; --chart-grid: #292524; } }
.colchart { display: flex; align-items: flex-end; gap: 2px; height: 180px; padding-top: 22px; border-bottom: 1px solid var(--chart-grid); }
.colchart .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; outline: none; }
.colchart .col .fill { background: var(--series-1); border-radius: 4px 4px 0 0; min-height: 1px; margin: 0 2px; transition: filter .1s; }
.colchart .col:hover .fill, .colchart .col:focus .fill { filter: brightness(1.15); }
.colchart .col .tip { display: none; position: absolute; bottom: calc(100% - 18px); left: 50%; transform: translateX(-50%); background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 6px; padding: 4px 8px; font-size: 12px; white-space: nowrap; z-index: 5; pointer-events: none; }
.colchart .col:hover .tip, .colchart .col:focus .tip { display: block; }
.colchart-labels { display: flex; gap: 2px; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.colchart-labels span { flex: 1; text-align: center; overflow: hidden; white-space: nowrap; }
.bar-fill { background: var(--series-1); border-radius: 0 4px 4px 0; }
.bar-row .bar-value { text-align: right; font-variant-numeric: tabular-nums; }
.bar-row .bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.table-view summary { cursor: pointer; color: var(--text-muted); font-size: 12px; margin-top: 8px; }
a.kpi { display: block; color: inherit; } a.kpi:hover { text-decoration: none; border-color: var(--primary); }

/* Agenda */
.agenda { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.agenda-jour { min-height: 180px; padding: 10px; margin: 0; }
.agenda-jour h3 { font-size: 13px; text-transform: capitalize; color: var(--text-muted); }
.agenda-aujourdhui { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.agenda-item { font-size: 12px; margin-bottom: 6px; line-height: 1.35; }
@media (max-width: 1100px) { .agenda { grid-template-columns: 1fr; } }

/* Bouton « + Nouveau » */
.nouveau { position: relative; }
.nouveau summary { list-style: none; }
.nouveau summary::-webkit-details-marker { display: none; }
.nouveau-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(15, 23, 42, .15); padding: 6px; min-width: 260px; }
.nouveau-menu a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 6px; color: var(--text); font-weight: 500; }
.nouveau-menu a:hover { background: var(--surface-2); text-decoration: none; }
.nav-parametres { margin-top: 14px; border-top: 1px solid #1e293b; padding-top: 12px !important; font-weight: 600; color: #e2e8f0 !important; }
.param-groupe ul { margin: 8px 0 0; padding-left: 18px; }
.param-groupe li { margin: 4px 0; }
.param-groupe h2 { margin-bottom: 4px; }

/* Actions rapides (tableau de bord, fiches) */
.raccourcis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.raccourci { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); font-weight: 600; }
.raccourci span { font-size: 22px; }
.raccourci:hover { border-color: var(--primary); text-decoration: none; }
.raccourci small { font-weight: 400; color: var(--text-muted); }

/* Saisie guidée */
.etape h2 { display: flex; align-items: center; gap: 10px; }
.num-etape { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 13px; }
.choix-onglets { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.choix { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-weight: 600; background: var(--surface); }
.choix:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.choix input { width: auto; margin: 0; }
.choix-ligne { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.choix-ligne input { width: auto; }
.client-choisi { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border: 1px solid var(--primary); background: var(--primary-soft); border-radius: 8px; font-weight: 600; }
.resultats-clients { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.resultat-client { text-align: left; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; font: inherit; color: var(--text); }
.resultat-client:hover { border-color: var(--primary); background: var(--surface-2); }
.plus-options summary { cursor: pointer; color: var(--primary); margin-top: 10px; }
.panneau-fixe { position: sticky; top: 70px; }
.btn-large { width: 100%; justify-content: center; padding: 12px; font-size: 15px; margin-top: 12px; }
.decompte-direct td { padding: 5px 8px; }
.decompte-cabinet { display: grid; gap: 4px; margin-top: 10px; padding: 10px; border-radius: 8px; background: var(--surface-2); }
.decompte-cabinet div { display: flex; justify-content: space-between; font-size: 13px; }
.tableau-saisie input.montant { text-align: right; max-width: 130px; }
.form-row.has-error input, .form-row.has-error select { border-color: var(--danger); }
.hidden { display: none !important; }
.section-form { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
.section-form:first-of-type { border-top: 0; margin-top: 0; }
.section-form h3 { margin-bottom: 10px; }
details.section-form summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.bandeau-suite { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--text); }
.bandeau-suite strong { color: var(--success); margin-right: 4px; }

/* Barre de sélection (reversements, encaissements…) */
.barre-selection { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 12px 18px; margin: 12px -18px -16px; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 12px rgba(0,0,0,.05); }
.barre-selection .gros { font-size: 16px; }
.filters .recherche-liste { flex: 1 1 320px; min-width: 260px; }
.filters select.filtre-actif { border-color: var(--primary); background: var(--primary-soft, #eef2ff); }
.filters .periode { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filters .periode input[type=date] { min-width: 0; }

/* Recherche dans les listes déroulantes et filtre des tableaux */
.select-recherche { display: block; width: 100%; margin-bottom: 4px; padding: 5px 8px; font-size: 13px; }
.filters .select-recherche { display: inline-block; width: 150px; min-width: 0; margin: 0; }
.filtre-tableau { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.filtre-tableau .input { max-width: 520px; }
tr.masque-filtre { display: none !important; }
tr.ligne-choisie td { background: var(--primary-soft); }
.filters div > input[type=search].input:not(.select-recherche) { width: 100%; }
.filters input.select-recherche { display: inline-block; width: 130px; min-width: 0; margin: 0 4px 0 0; }
.filters input[type=checkbox] { width: auto; min-width: 0; }

/* Formulaires par étapes */
.etapes-entete { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 12px; }
.etapes-entete li { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; font-weight: 600; color: var(--text-muted); }
.etapes-entete li.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.etapes-entete li.active .num-etape { background: #fff; color: var(--primary); }
.etapes-entete li.faite { color: var(--text); border-color: var(--primary); }
.etapes-entete li.a-erreur { border-color: var(--danger, #dc2626); color: var(--danger, #dc2626); }
.etape-panneau .form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
ul.choix-multiples, .choix-multiples ul, div.choix-multiples { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 16px; }
.choix-multiples label { display: flex; gap: 6px; align-items: center; font-weight: 400; }
.form-row > div[id^="id_"]:has(input[type=checkbox]), .form-row > div[id^="id_"]:has(input[type=radio]) { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 16px; }
.form-row > div[id^="id_"] label { display: flex; gap: 6px; align-items: center; font-weight: 400; }
.form-row > div[id^="id_"] input[type=checkbox], .form-row > div[id^="id_"] input[type=radio] { width: auto; min-width: 0; }
.grid > *, .card { min-width: 0; }

/* Téléphone : filtres des listes repliés derrière un bouton, les résultats d'abord (après les règles générales) */
@media (max-width: 760px) {
  .filters .btn-filtres { display: inline-flex; }
  .filters .filtres-plus { display: none; width: 100%; }
  .filters .filtres-plus.ouvert { display: flex; flex-wrap: wrap; gap: 8px; }
  .filters .recherche-liste { flex-basis: 100%; min-width: 0; }
}

/* Clients VIP : lignes signalées dans les listes */
.table tr.vip > td { background: #fff6dd; }
.table tr.vip > td:first-child { box-shadow: inset 3px 0 0 #d4a017; }
.badge-vip { background: #fff1c2; color: #8a6100; border-color: #e9c45a; }
@media (prefers-color-scheme: dark) { .table tr.vip > td { background: rgba(212, 160, 23, .14); } }
