/* Ma Recherche Alternance — surcouche du thème Spark Admin */
:root {
  --mra-primary: #0b5ed7;
}
.sidebar-brand small { display: block; font-size: .7rem; font-weight: 500; opacity: .7; letter-spacing: .02em; }
.mra-avatar { display: inline-flex; align-items: center; justify-content: center; background: var(--brand-lime); color: var(--brand-forest-dark); font-weight: 700; border-radius: 50%; width: 40px; height: 40px; font-size: .9rem; }
.mra-avatar-sm { width: 32px; height: 32px; font-size: .75rem; }
.mra-flash { margin: 1rem 1.5rem 0; border-radius: var(--radius-md); }
.navbar-search-wrapper { margin: 0; }
.btn-quick-action { display: inline-flex; align-items: center; gap: .4rem; }

/* Fiches établissements */
.etab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.etab-card { background: var(--card-background); border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; position: relative; }
.etab-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.etab-card.selected { outline: 2px solid var(--brand-lime); box-shadow: 0 0 0 4px var(--brand-lime-translucent); }
.etab-card .etab-photo { height: 120px; background: linear-gradient(135deg, var(--brand-forest-medium), var(--brand-forest-light)); background-size: cover; background-position: center; position: relative; }
.etab-card .etab-photo .etab-note { position: absolute; left: .6rem; bottom: .6rem; background: rgba(255,255,255,.95); border-radius: 999px; padding: .15rem .55rem; font-size: .75rem; font-weight: 600; }
.etab-card .etab-photo .etab-rang { position: absolute; left: .6rem; top: .6rem; background: rgba(0,0,0,.5); color: #fff; border-radius: 6px; padding: .1rem .4rem; font-size: .7rem; }
.etab-card .etab-check { position: absolute; right: .6rem; top: .6rem; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: rgba(255,255,255,.35); display: flex; align-items: center; justify-content: center; color: #fff; cursor: pointer; }
.etab-card.selected .etab-check { background: var(--brand-lime); color: var(--brand-forest-dark); border-color: var(--brand-lime); }
.etab-card .etab-body { padding: .8rem .9rem; flex: 1; display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; }
.etab-card .etab-nom { font-weight: 700; font-size: .95rem; color: var(--text-main); line-height: 1.25; }
.etab-card .etab-nom a { color: inherit; text-decoration: none; }
.etab-card .etab-adresse { color: var(--text-muted-green); font-size: .75rem; }
.etab-card .etab-ligne { display: flex; align-items: center; gap: .4rem; color: var(--text-main); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.etab-card .etab-ligne i { color: var(--text-muted-green); flex: 0 0 auto; }
.etab-card .etab-ligne a { color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.etab-card .etab-social { display: flex; gap: .6rem; margin-top: auto; padding-top: .3rem; font-size: 1rem; }
.etab-card .etab-social a { color: var(--text-muted-green); }
.etab-card .etab-social a:hover { color: var(--text-main); }
.badge-verifie { background: var(--sys-green-bg); color: #15803d; font-weight: 600; font-size: .68rem; border-radius: 999px; padding: .15rem .5rem; }
.badge-alternance { background: #dbeafe; color: #1d4ed8; font-weight: 600; font-size: .68rem; border-radius: 999px; padding: .15rem .5rem; }
.badge-sans-email { background: #f1f5f9; color: #64748b; font-weight: 500; font-size: .68rem; border-radius: 999px; padding: .15rem .5rem; }
.badge-source { background: #eef2ff; color: #4338ca; font-weight: 500; font-size: .65rem; border-radius: 6px; padding: .1rem .4rem; }

/* Carte */
#carte { height: 380px; border-radius: var(--radius-lg); border: 1px solid var(--border-light); z-index: 0; }
.leaflet-popup-content { font-size: .8rem; }
.leaflet-popup-content b { display: block; margin-bottom: .2rem; }

/* Compteurs */
.pill-stat { display: inline-flex; align-items: center; gap: .35rem; background: var(--card-background); border: 1px solid var(--border-light); border-radius: 999px; padding: .3rem .8rem; font-size: .8rem; font-weight: 600; }
.pill-stat .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sys-green); }

/* Barre de sélection collante */
.selection-bar { position: sticky; top: calc(var(--navbar-height) + .5rem); z-index: 5; background: var(--brand-forest-dark); color: #fff; border-radius: var(--radius-lg); padding: .8rem 1rem; box-shadow: var(--shadow-lg); }
.selection-bar .form-select, .selection-bar .form-control { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); }
.selection-bar .form-select option { color: #000; }
.selection-bar .btn-lime { background: var(--brand-lime); color: var(--brand-forest-dark); font-weight: 700; border: 0; }
.selection-bar .btn-lime:disabled { opacity: .5; }

/* Chips secteurs */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label { border: 1px solid var(--border-light); border-radius: 999px; padding: .3rem .8rem; font-size: .8rem; cursor: pointer; background: #fff; transition: all .1s; }
.chips input:checked + label { background: var(--brand-forest-dark); color: #fff; border-color: var(--brand-forest-dark); }
.chips input:focus-visible + label { outline: 2px solid var(--brand-lime); }
.segmented { display: inline-flex; border: 1px solid var(--border-light); border-radius: var(--radius-md); overflow: hidden; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { padding: .45rem .9rem; font-size: .85rem; cursor: pointer; background: #fff; border-right: 1px solid var(--border-light); }
.segmented label:last-child { border-right: 0; }
.segmented input:checked + label { background: var(--brand-forest-dark); color: #fff; }

/* Progression recherche */
.progress-recherche { height: 10px; border-radius: 999px; }
.progress-recherche .progress-bar { background: var(--brand-lime); }
.etape-recherche { font-size: .85rem; color: var(--text-muted-green); }

/* Statuts pipeline */
.statut-a_envoyer { background: #f1f5f9; color: #475569; }
.statut-envoye { background: #e0f2fe; color: #0369a1; }
.statut-repondu { background: #fef9c3; color: #a16207; }
.statut-interesse { background: #dcfce7; color: #15803d; }
.statut-rdv { background: #d1fae5; color: #047857; }
.statut-perdu { background: #fee2e2; color: #b91c1c; }
.statut-erreur { background: #fee2e2; color: #b91c1c; }
.statut-ignore { background: #f1f5f9; color: #94a3b8; }
.badge-statut { font-weight: 600; font-size: .7rem; border-radius: 999px; padding: .2rem .6rem; white-space: nowrap; }

/* Fil de messages */
.fil-message { border-left: 3px solid var(--border-light); padding: .5rem .8rem; margin-bottom: .6rem; background: #fff; border-radius: 0 var(--radius-md) var(--radius-md) 0; font-size: .85rem; }
.fil-message.recu { border-left-color: var(--sys-green); background: #f0fdf4; }
.fil-message .meta { font-size: .72rem; color: var(--text-muted-green); }
.fil-message pre { white-space: pre-wrap; font-family: inherit; margin: .3rem 0 0; font-size: .85rem; }

/* Divers */
.card { border-radius: var(--radius-lg); border: 1px solid var(--border-light); }
.card .card-header { background: transparent; border-bottom: 1px solid var(--border-light); font-weight: 600; }
.table-sm td, .table-sm th { font-size: .85rem; vertical-align: middle; }
textarea.mail-corps { min-height: 320px; font-family: inherit; font-size: .9rem; line-height: 1.5; }
.variable-chip { display: inline-block; background: #eef2ff; color: #4338ca; border-radius: 6px; padding: .05rem .4rem; font-family: ui-monospace, monospace; font-size: .75rem; cursor: pointer; }
.kpi-card { background: var(--card-background); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 1rem 1.2rem; height: 100%; }
.kpi-card .kpi-label { font-size: .78rem; color: var(--text-muted-green); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi-card .kpi-value { font-size: 1.8rem; font-weight: 800; color: var(--text-main); line-height: 1.1; margin: .3rem 0; }
.kpi-card .kpi-sub { font-size: .75rem; color: var(--text-muted-green); }
.kpi-card .kpi-icon { float: right; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-lime-translucent); color: var(--brand-forest-dark); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.page-header { flex-wrap: wrap; gap: .8rem; }
.aide h2 { font-size: 1.1rem; margin-top: 1.5rem; }
.suggestion-card { background: #fffbeb; border: 1px dashed #f59e0b; }
@media (max-width: 767px) { #carte { height: 260px; } .selection-bar { top: .5rem; } }
