/* ==========================================================================
   Nomad Prospection — Design system
   Light mode only, surfaces pleines et opaques (pas de glassmorphisme, pas
   de blur). CSS 100% custom : aucune dependance a Bootstrap ou tout autre
   framework CSS. Esprit Stripe / Linear / Vercel en light : beaucoup de
   blanc, bordures fines, ombres tres douces, aplats de couleur.
   ========================================================================== */

/* --------------------------------------------------------------------- */
/* 1. Design tokens                                                       */
/* --------------------------------------------------------------------- */
:root {
    --bg: #F7F8FA;
    --surface: #FFFFFF;
    --surface-muted: #F3F4F6;
    --surface-hover: #F9FAFB;
    --border: #E5E7EB;
    --border-strong: #D1D5DB;

    --text: #111827;
    --text-muted: #6B7280;
    --text-faint: #9CA3AF;

    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-soft: #EEF2FF;
    --primary-soft-border: #C7D2FE;

    --success: #16A34A;
    --success-soft: #DCFCE7;
    --success-text: #166534;

    --danger: #DC2626;
    --danger-soft: #FEE2E2;
    --danger-text: #991B1B;

    --warning: #D97706;
    --warning-soft: #FEF3C7;
    --warning-text: #92400E;

    --info: #0284C7;
    --info-soft: #E0F2FE;
    --info-text: #075985;

    --secondary-soft: #F3F4F6;
    --secondary-text: #374151;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.06);
    --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, 0.10);

    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------- */
/* 2. Reset / base                                                        */
/* --------------------------------------------------------------------- */
* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-body);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    margin-top: 0;
}

p {
    margin-top: 0;
}

code {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    font-size: 0.85em;
}

a {
    color: var(--primary);
    transition: color 150ms var(--ease);
}

a:hover {
    color: var(--primary-hover);
}

::selection {
    background: var(--primary-soft-border);
    color: var(--text);
}

/* Scrollbar discrete */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--radius-pill);
    border: 2px solid var(--bg);
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
    background-clip: padding-box;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* --------------------------------------------------------------------- */
/* 3. Shell / layout                                                      */
/* --------------------------------------------------------------------- */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-main {
    flex: 1;
    padding-bottom: 4rem;
}

.app-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem 0;
}

/* Topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.topbar__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
}

.brand:hover {
    color: var(--text);
}

.brand__mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--primary);
    flex-shrink: 0;
}

.brand__text {
    font-size: 1.02rem;
    letter-spacing: -0.01em;
}

.brand__sep {
    color: var(--primary);
}

.topbar__nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --------------------------------------------------------------------- */
/* 4. Buttons                                                             */
/* --------------------------------------------------------------------- */
.btn {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    padding: 0.55rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), box-shadow 150ms var(--ease);
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.83rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.98rem;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #FFFFFF;
}

.btn-ghost {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-submit {
    padding-inline: 1.75rem;
}

/* --------------------------------------------------------------------- */
/* 5. Cards (surfaces pleines, opaques)                                   */
/* --------------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    color: var(--text);
}

.form-card {
    padding: 0;
}

.summary-card,
.status-card,
.results-card {
    padding: 1.5rem;
}

.status-card {
    margin-bottom: 1.25rem;
}

.results-card {
    padding: 0;
}

.results-summary {
    padding: 1.5rem 1.5rem 0;
    margin-bottom: 1rem;
}

.results-card .table-responsive {
    padding-bottom: 0.25rem;
}

.summary-card {
    margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------- */
/* 6. Page headers                                                        */
/* --------------------------------------------------------------------- */
.page-header {
    margin-bottom: 1.75rem;
}

.page-header--row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.eyebrow {
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--primary);
    margin-bottom: 0.35rem;
}

.page-title {
    font-size: clamp(1.4rem, 1.15rem + 1vw, 1.9rem);
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.page-title--flush {
    margin-bottom: 0;
}

.page-subtitle {
    color: var(--text-muted);
    margin-bottom: 0;
    max-width: 60ch;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.back-link:hover {
    color: var(--primary);
}

.ref-code {
    font-size: 0.85em;
    background: var(--surface-muted);
}

/* --------------------------------------------------------------------- */
/* 7. Forms                                                               */
/* --------------------------------------------------------------------- */
.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.87rem;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.form-text {
    color: var(--text-faint);
    font-size: 0.82rem;
    margin-top: 0.35rem;
}

.form-control,
.form-select,
.search-input {
    width: 100%;
    background-color: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.92rem;
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.85rem;
    transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

.form-control::placeholder,
.search-input::placeholder {
    color: var(--text-faint);
}

.form-control:focus,
.form-select:focus,
.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236B7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.25rem;
}

.search-input {
    margin-bottom: 0.9rem;
}

textarea.form-control {
    resize: vertical;
}

.invalid-feedback,
.form-error {
    display: block;
    color: var(--danger);
    font-size: 0.82rem;
    margin-top: 0.35rem;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger);
}

/* Wrapping div produced by Symfony form_row/form_div_layout */
.form-section .field-grid > div > div,
.form-section > div {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------- */
/* 8. Form sections (prospection/new)                                     */
/* --------------------------------------------------------------------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 1.75rem;
}

.form-section {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.form-section--span2 {
    grid-column: 1 / -1;
}

.form-section__header {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}

.form-section__index {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-section__title {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.form-section__hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0;
}

.form-actions {
    padding: 1.25rem 1.75rem 1.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

/* Grille de champs custom (remplace le systeme de grille Bootstrap row/col) */
.field-grid {
    display: grid;
    gap: 1rem;
}

.field-grid--12 {
    grid-template-columns: 1fr 2fr;
}

.field-grid--111 {
    grid-template-columns: repeat(3, 1fr);
}

.field-grid--11,
.field-grid--22 {
    grid-template-columns: repeat(2, 1fr);
}

/* Empilement vertical (ex: widgets CA / effectif dans la section Ciblage,
   devenue plus etroite depuis qu'elle partage sa rangee avec la Zone geo). */
.field-grid--1 {
    grid-template-columns: 1fr;
}

@media (max-width: 991.98px) {
    .form-grid {
        grid-template-columns: 1fr;
        padding: 1.25rem;
    }
    .field-grid--12,
    .field-grid--111,
    .field-grid--11,
    .field-grid--22 {
        grid-template-columns: 1fr;
    }
    .form-actions {
        padding: 1.25rem;
    }
    .btn-submit {
        width: 100%;
        justify-content: center;
    }
}

/* --------------------------------------------------------------------- */
/* 8bis. Liste cle/valeur repetable (key_value_controller.js)             */
/*       Utilisee pour les headers de retour (callback) du formulaire de  */
/*       prospection, style "Add Header" n8n.                             */
/* --------------------------------------------------------------------- */
.key-value {
    margin-top: 1.5rem;
}

.key-value__hint {
    margin-top: 0.1rem;
    margin-bottom: 0.75rem;
}

.key-value__rows {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.key-value__row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.6rem;
    align-items: center;
}

.key-value__remove {
    padding: 0.55rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.key-value__remove:hover {
    color: var(--danger);
    border-color: var(--danger-soft);
    background: var(--danger-soft);
}

.key-value__add {
    align-self: flex-start;
}

@media (max-width: 575.98px) {
    .key-value__row {
        grid-template-columns: 1fr;
    }

    .key-value__remove {
        justify-self: flex-end;
    }
}

/* --------------------------------------------------------------------- */
/* 9. Carte de France (departements_map_controller.js)                    */
/* --------------------------------------------------------------------- */
.departements-map {
    padding: 0;
}

.departements-map__stage {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

.departements-map__svg {
    width: 100%;
    max-width: 440px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.departement-path {
    fill: var(--surface-muted);
    stroke: var(--surface);
    stroke-width: 0.6;
    cursor: pointer;
    transition: fill 150ms var(--ease), stroke-width 150ms var(--ease);
}

.departement-path:hover {
    fill: var(--primary-soft-border);
}

.departement-path:focus-visible {
    outline: none;
    stroke: var(--primary);
    stroke-width: 1.6;
}

.departement-path.selected {
    fill: var(--primary);
}

.departement-path.selected:hover {
    fill: var(--primary-hover);
}

.departement-path.highlight {
    stroke: var(--warning);
    stroke-width: 1.8;
}

.departements-map__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 0.9rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.departements-map__legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

.legend-swatch--default {
    background: var(--surface-muted);
    border: 1px solid var(--border-strong);
}

.legend-swatch--selected {
    background: var(--primary);
}

.legend-swatch--highlight {
    background: transparent;
    border: 1.8px solid var(--warning);
}

.departements-map__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    min-height: 2rem;
    margin-top: 1rem;
}

/* --------------------------------------------------------------------- */
/* 10. Chips (generic)                                                    */
/* --------------------------------------------------------------------- */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.7rem;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
}

.chip--dep {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid var(--primary-soft-border);
    animation: chipIn 180ms var(--ease);
}

.chip__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: none;
    background: var(--primary-soft-border);
    color: var(--primary);
    padding: 0;
    cursor: pointer;
    transition: background 150ms var(--ease);
}

.chip__remove:hover {
    background: var(--primary);
    color: #FFFFFF;
}

.chip--summary {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    color: var(--text);
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.55rem 0.9rem;
    border-radius: var(--radius-sm);
    font-weight: 400;
}

.chip--summary strong {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    font-weight: 700;
}

@keyframes chipIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .chip--dep { animation: none; }
}

/* --------------------------------------------------------------------- */
/* 11. Slider + champ numerique synchronises (range_number_controller.js) */
/*     Generalise depuis l'ancien .ca-slider : reutilise pour le CA       */
/*     minimum ET l'effectif minimum.                                     */
/* --------------------------------------------------------------------- */
.range-number {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1rem 1rem;
}

.range-number__row {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

/* Conteneur commun a la piste ET aux graduations : meme largeur pour les
   deux, donc les ticks restent alignes sur les positions reelles du curseur
   (i/(N-1)*100%, calcule cote Twig / range_number_controller.js). Le champ
   numerique (.range-number__number) est un frere en dehors de ce conteneur,
   largeur fixe, jamais couvert par les ticks. */
.range-number__slider {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}

.range-number__range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    display: block;
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--border-strong);
    outline: none;
}

.range-number__range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 3px solid var(--primary);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: transform 150ms var(--ease);
}

.range-number__range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.range-number__range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 3px solid var(--primary);
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.range-number__range::-moz-range-track {
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--border-strong);
}

.range-number__range:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

/* Champ numerique accole au slider : largeur fixe, chiffres alignes */
.range-number__number {
    flex: 0 0 auto;
    width: 8.5rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Graduations positionnees en absolu a i/(N-1)*100% (calcule cote Twig) pour
   rester alignees avec les positions d'index du slider (range_number_controller.js),
   plutot qu'un flex space-between qui ne respecte pas les fractions exactes
   des lors que les libelles ont des largeurs differentes ("0" vs "10M+").
   .range-number__ticks vit DANS .range-number__slider (meme largeur que la
   piste), donc left:0%/100% correspond bien aux extremites reelles du
   curseur — ce n'est plus un frere qui s'etend sur toute la largeur du
   composant (piste + champ numerique). */
.range-number__ticks {
    position: relative;
    width: 100%;
    height: 1rem;
    margin-top: 0.6rem;
}

.range-number__tick {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-size: 0.72rem;
    color: var(--text-faint);
    white-space: nowrap;
}

.range-number__tick:first-child {
    transform: translateX(0);
}

.range-number__tick:last-child {
    transform: translateX(-100%);
}

.range-number__output {
    font-weight: 700;
    font-size: 1.02rem;
    margin: 0.9rem 0 0;
    color: var(--primary);
}

@media (max-width: 575.98px) {
    .range-number__row {
        flex-direction: column;
        align-items: stretch;
    }
    .range-number__number {
        width: 100%;
        text-align: left;
    }
}

/* --------------------------------------------------------------------- */
/* 12. Tables                                                             */
/* --------------------------------------------------------------------- */
.table-card {
    padding: 0;
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th,
.table td {
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: var(--surface-hover);
}

.table thead th {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom-color: var(--border-strong);
}

.table--compact th,
.table--compact td {
    padding: 0.65rem 0.9rem;
    font-size: 0.85rem;
}

.table-prospects td a {
    color: var(--primary);
}

/* --------------------------------------------------------------------- */
/* 13. Badges de statut                                                   */
/* --------------------------------------------------------------------- */
.badge-status {
    font-weight: 600;
    letter-spacing: 0.02em;
    font-size: 0.78rem;
    padding: 0.35em 0.8em;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.45em;
    white-space: nowrap;
}

.badge-status.text-bg-secondary {
    background: var(--secondary-soft);
    color: var(--secondary-text);
    border-color: var(--border-strong);
}

.badge-status.text-bg-primary {
    background: #EEF2FF;
    color: #4F46E5;
    border-color: #C7D2FE;
}

.badge-status.text-bg-info {
    background: var(--info-soft);
    color: var(--info-text);
    border-color: #BAE6FD;
}

.badge-status.text-bg-success {
    background: var(--success-soft);
    color: var(--success-text);
    border-color: #BBF7D0;
}

.badge-status.text-bg-danger {
    background: var(--danger-soft);
    color: var(--danger-text);
    border-color: #FECACA;
}

.spinner-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    animation: statusPulse 1.3s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
    .spinner-dot { animation: none; }
}

/* --------------------------------------------------------------------- */
/* 14. Empty state                                                        */
/* --------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    margin-bottom: 1.25rem;
}

.empty-state__title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.empty-state__text {
    color: var(--text-muted);
    max-width: 42ch;
    margin: 0 auto 1.75rem;
}

/* --------------------------------------------------------------------- */
/* 15. Alerts (bandeaux clairs)                                          */
/* --------------------------------------------------------------------- */
.alert {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}

.alert__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.alert__msg {
    flex: 1;
}

.alert__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: currentColor;
    opacity: 0.6;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.alert__close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

.alert-success { background: var(--success-soft); color: var(--success-text); border-color: #BBF7D0; }
.alert-danger { background: var(--danger-soft); color: var(--danger-text); border-color: #FECACA; }
.alert-warning { background: var(--warning-soft); color: var(--warning-text); border-color: #FDE68A; }
.alert-info { background: var(--info-soft); color: var(--info-text); border-color: #BAE6FD; }

/* --------------------------------------------------------------------- */
/* 16. Auth (login)                                                       */
/* --------------------------------------------------------------------- */
.auth-shell {
    min-height: calc(100vh - 6rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2.25rem 2rem;
}

.auth-card__brand {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.auth-card__brand .brand__mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

.auth-card__title {
    text-align: center;
    font-size: 1.35rem;
    margin-bottom: 0.35rem;
}

.auth-card__subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.field {
    display: flex;
    flex-direction: column;
}

/* --------------------------------------------------------------------- */
/* 17. Summary details (prospection/show)                                 */
/* --------------------------------------------------------------------- */
.summary-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.summary-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 1.5rem;
    margin: 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.summary-details dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.summary-details dd {
    margin: 0;
    word-break: break-word;
}

@media (max-width: 767.98px) {
    .summary-details {
        grid-template-columns: 1fr;
    }
}

.callback-headers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.callback-headers__item {
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
}

.callback-headers__item strong {
    font-size: 0.72rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
    font-weight: 700;
}

/* --------------------------------------------------------------------- */
/* 18. Status card (ProspectionRunStatus)                                 */
/* --------------------------------------------------------------------- */
.status-card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.status-card__left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* --------------------------------------------------------------------- */
/* 19. Tom Select — theme light                                          */
/* --------------------------------------------------------------------- */
.ts-wrapper .ts-control {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text) !important;
    padding: 0.4rem 0.6rem !important;
    box-shadow: none !important;
}

.ts-wrapper.focus .ts-control {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-soft) !important;
}

.ts-wrapper .ts-control input {
    color: var(--text) !important;
}

.ts-wrapper .ts-control input::placeholder {
    color: var(--text-faint) !important;
}

.ts-control > .item {
    background: var(--primary-soft) !important;
    color: var(--primary) !important;
    border: 1px solid var(--primary-soft-border) !important;
    border-radius: var(--radius-pill) !important;
    padding: 0.15rem 0.4rem 0.15rem 0.7rem !important;
    font-weight: 600;
    font-size: 0.82rem;
}

.ts-wrapper.plugin-remove_button .item .remove {
    border-left: 1px solid var(--primary-soft-border) !important;
    color: var(--primary) !important;
}

.ts-wrapper.plugin-remove_button .item .remove:hover {
    background: var(--primary-soft-border) !important;
}

.ts-dropdown {
    background: var(--surface) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-lg) !important;
    color: var(--text) !important;
    margin-top: 6px !important;
}

.ts-dropdown .ts-dropdown-content {
    padding: 0.3rem;
}

.ts-dropdown [data-selectable],
.ts-dropdown .option {
    color: var(--text) !important;
    border-radius: 8px;
    padding: 0.5rem 0.65rem !important;
}

.ts-dropdown .option.active,
.ts-dropdown [data-selectable].active {
    background: var(--primary-soft) !important;
    color: var(--primary) !important;
}

.ts-dropdown .no-results {
    color: var(--text-muted) !important;
    padding: 0.6rem 0.65rem;
}

/* --------------------------------------------------------------------- */
/* 20. Profile picker — configurations pre-remplies par societe          */
/*     (prospection/new.html.twig, profile_picker_controller.js)         */
/* --------------------------------------------------------------------- */

/* Action secondaire "Reinitialiser", alignee a droite du header de section
   (bouton .btn.btn-ghost.btn-sm standard, cf. section 4. Buttons). */
.profile-picker__reset-btn {
    margin-left: auto;
    flex-shrink: 0;
    align-self: center;
}

.profile-picker__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.profile-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.15rem;
    cursor: pointer;
    font-family: var(--font-body);
    box-shadow: var(--shadow-sm);
    transition: border-color 150ms var(--ease), background 150ms var(--ease), box-shadow 150ms var(--ease), transform 150ms var(--ease);
}

.profile-card:hover {
    border-color: var(--primary-soft-border);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.profile-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Pastille d'initiales — couleur cyclee sur une petite palette de tokens
   existants (5 teintes), stable par profil via loop.index0 % 5 (Twig). */
.profile-card__avatar {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.profile-card__avatar--0 { background: var(--primary-soft); color: var(--primary); }
.profile-card__avatar--1 { background: var(--info-soft); color: var(--info-text); }
.profile-card__avatar--2 { background: var(--success-soft); color: var(--success-text); }
.profile-card__avatar--3 { background: var(--warning-soft); color: var(--warning-text); }
.profile-card__avatar--4 { background: var(--secondary-soft); color: var(--secondary-text); }

.profile-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    width: 100%;
}

.profile-card__label {
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.35;
    color: var(--text);
    overflow-wrap: break-word;
}

.profile-card__description {
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Ligne de meta (recap cible), poussee en bas de carte pour aligner les
   hauteurs entre cartes voisines (le bouton .profile-card est stretch par
   la grille CSS). */
.profile-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.4rem;
    margin-top: auto;
    padding-top: 0.65rem;
    border-top: 1px dashed var(--border);
    width: 100%;
}

.profile-card__meta-item {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 0.18rem 0.55rem;
    line-height: 1.5;
    white-space: nowrap;
}

/* Coche d'etat actif, masquee par defaut */
.profile-card__check {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 150ms var(--ease), transform 150ms var(--ease);
}

.profile-card.is-active {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 0 0 1px var(--primary) inset, var(--shadow-md);
}

.profile-card.is-active .profile-card__label {
    color: var(--primary);
}

.profile-card.is-active .profile-card__check {
    opacity: 1;
    transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
    .profile-card,
    .profile-card__check {
        transition: none;
    }
    .profile-card:hover {
        transform: none;
    }
}

@media (max-width: 575.98px) {
    .profile-picker__grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------- */
/* 21. Utilities                                                         */
/* --------------------------------------------------------------------- */
.text-muted {
    color: var(--text-muted) !important;
}

.text-danger {
    color: var(--danger) !important;
}
