/* ===== Panel : éléments propres à chaque page ===== */

/* ---------- Demandes des agents ---------- */
.RequestCard { padding-top: 4px; padding-bottom: 4px; }
.Request { padding: 14px 0; }
.Request + .Request { border-top: 1px solid var(--Edge); }
.RequestList > .Request:first-child { padding-top: 2px; }
.RequestCard .RequestList > .Request:first-child { padding-top: 14px; }
.RequestHead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.RequestAgent { font-weight: 600; text-decoration: none; }
.RequestAgent:hover { text-decoration: underline; text-underline-offset: 3px; }
.RequestText { margin: 6px 0 10px; }
.Request.IsDecided .RequestText { color: var(--Muted); }
.RequestActions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }


/* ---------- Mensualités : sur téléphone, chaque ligne passe sur deux lignes ---------- */
@media (max-width: 600px) {
  .BillsTable thead { display: none; }
  .BillsTable tr { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; column-gap: 8px; row-gap: 4px; padding: 10px 0; border-top: 1px solid var(--Edge); }
  .BillsTable td { padding: 0; border-top: 0; }
  .BillsTable .BillStatus { grid-column: 2; }
  .BillsTable .BillAction { grid-column: 3; }
  .BillsTable tfoot tr { grid-template-columns: minmax(0, 1fr) auto; border-top: 1px solid var(--Edge); }
  .BillsTable tfoot th { padding: 0; border-top: 0; }
  .BillsTable tfoot th:last-child { grid-column: 1 / -1; }
}


/* ---------- Résumé des modèles (tableau de bord) ---------- */
.ModelRows { display: grid; margin: 0 -8px; }
.ModelRow {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 8px; border-radius: var(--RadiusControl); text-decoration: none;
}
.ModelRow:hover { background: var(--Chip); }

/* À faire (tableau de bord) : une ligne par créatrice, ses étapes manquantes en pastilles */
.TodoList { display: grid; margin: 0 -8px; }
.TodoRow {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 8px; border-radius: var(--RadiusControl); color: inherit; text-decoration: none;
}
.TodoRow:hover { background: var(--Chip); }
.TodoIcon { color: var(--Muted); }
.TodoName { display: grid; gap: 5px; min-width: 0; }
.TodoName strong { font-weight: 600; }
.TodoSteps { display: flex; flex-wrap: wrap; gap: 4px; }
.TodoStep {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: var(--RadiusInner); background: var(--Chip); color: var(--Muted); font-size: 12px;
}
.TodoStep .Icon { width: 12px; height: 12px; }
.TodoRow:hover .TodoStep { background: var(--ChipActive); }
.ModelRowName { display: grid; min-width: 0; }
.ModelRowName strong { font-weight: 600; }
.ModelRow .Num { display: grid; justify-items: end; }
.ModelRow .Num strong { font-weight: 600; }
.ModelRows { position: relative; }
/* Liste coupée : la dernière ligne s'efface dans le fond de la carte, sous « Voir plus » */
.ModelRows::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 72px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--PanelSolid) 85%);
  opacity: 0; transition: opacity 320ms ease;
}
.ModelRows.IsClipped::after { opacity: 1; }
.ModelsMore { position: relative; z-index: 1; display: flex; justify-content: center; margin-top: -28px; }


/* ---------- Activité en direct ---------- */
.ActivityList { display: grid; margin: 0 -8px; }
.ActivityRow {
  display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: start; gap: 10px;
  padding: 8px; border-radius: var(--RadiusControl); text-decoration: none;
}
.ActivityRow:hover { background: var(--Chip); }
.ActivityRow > .Icon { margin-top: 3px; color: var(--Muted); }
.ActivityRow .Small { margin-top: 2px; }
.ActivityList > .Empty { padding: 0 8px; }
button.ActivityRow { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }

/* Détail d'une notification (fenêtre ouverte au clic) */
.NotificationWhen { display: flex; align-items: center; gap: 8px; }
.NotificationDetail { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.RecapFigures { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; }
.RecapFigure { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--RadiusInner); background: var(--Chip); }
.RecapFigure strong { font-size: 18px; font-weight: 600; }
.RecapSection { display: grid; gap: 6px; }
.RecapSection h3 { margin: 0; font-weight: 600; }
.RecapSection p { margin: 0; }
.RecapLink {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: var(--RadiusInner); background: var(--Chip); color: inherit; text-decoration: none;
  transition: background 160ms var(--Ease);
}
.RecapLink:hover { background: var(--ChipActive); }
.RecapLink .Icon { width: 13px; height: 13px; color: var(--Muted); }
.NotificationDetail li { padding: 8px 10px; border-radius: var(--RadiusInner); background: var(--Chip); line-height: 1.45; }


/* ---------- Liste des modèles ---------- */
/* En-tête : recherche, tri et ajout regroupés à droite, à la même hauteur que la recherche */
.PageHead .SearchBox { margin-left: auto; }
.PageHead .Combo .ComboButton { height: 36px; padding: 0 12px; font-size: 13px; }
.PageHead .Btn { height: 36px; }
.ReceivedCard { margin: 0 0 16px; }
.ReceivedCard .FileList { margin: 0; }
.ReceivedCard .Btn { height: 30px; padding: 0 12px; font-size: 13px; }
.ModelGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.ModelCard { display: block; }
.ModelCardHead { display: grid; grid-template-columns: 64px minmax(0, 1fr) 14px; align-items: center; gap: 14px; }
.ModelCardHead > .Icon { color: var(--Muted); }
.ModelCardName { min-width: 0; }
.ModelCardName h2 { margin: 0 0 2px; font-size: 18px; }
.ModelCardName p { margin: 0; }
.ModelCardName .Networks { margin: 4px 0 0 -8px; }
.ModelCard { cursor: pointer; outline: none; }
.ModelCard:hover { background: color-mix(in srgb, var(--PanelSolid) 60%, var(--Chip)); }
.Facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--Edge); }
.Facts div { min-width: 0; }
.Facts dt { font-size: 12px; color: var(--Muted); }
.Facts dd { margin: 0; }
.Facts dd:first-of-type { font-size: 22px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }


/* ---------- Page d'une modèle ---------- */
.BackLink { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 14px; font-size: 13px; color: var(--Muted); text-decoration: none; }
.BackLink:hover { color: var(--Ink); }
.BackLink .Icon { width: 12px; height: 12px; }
.ModelHead { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.ModelHead h1 { margin: 0 0 4px; font-size: 26px; }
.ModelHead p { margin: 0; }
.ModelHeadText { min-width: 0; }
.ModelHeadText .Networks { margin: 6px 0 0 -8px; }

/* Nom du réseau avec son icône ; lien vers le compte de la modèle */
.NetworkName { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.NetworkName .Icon { width: 14px; height: 14px; color: var(--Muted); }
a.NetworkName:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Barre de répartition : une seule barre, parts proportionnelles, valeur dans la part si elle tient */
/* Répartition du CA : barre fine (piste grise quand rien n'est encore entré), puis une ligne par
   source alignée en colonnes : pastille, nom, part, montant */
.SplitBar { display: flex; gap: 2px; height: 8px; overflow: hidden; border-radius: 4px; background: var(--Chip); }
.SplitBar span { min-width: 3px; }
.SplitLegend { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto auto; align-items: center; gap: 12px 10px; margin-top: 16px; font-size: 13px; }
.SplitLegend > div { display: contents; }
.SplitShare { min-width: 3ch; text-align: right; color: var(--Muted); font-variant-numeric: tabular-nums; }
.SplitLegend strong { min-width: 64px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.SplitLegend .IsZero { color: var(--Muted); font-weight: 500; }


/* ---------- Profil ---------- */
/* Deux colonnes : les petites cartes à gauche (en grille), les notifications à droite.
   Ainsi la grande carte des notifications ne crée pas de vide sous les autres. */
.ProfileGrid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ProfileMain { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 16px; align-items: start; }
@media (max-width: 900px) { .ProfileGrid { grid-template-columns: minmax(0, 1fr); } }
.FormCard { display: grid; gap: 12px; }
.FormCard .CardHead { margin-bottom: 0; }
.FormCard p { margin: 0; }
.FormActions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.AvatarEditor { display: flex; align-items: center; gap: 16px; }
.AvatarButtons { display: grid; justify-items: start; gap: 8px; }
.InlineForm { display: flex; align-items: flex-end; gap: 8px; }
.InlineForm .Field { flex: 1; }
.InlineForm .Btn { height: 36px; }

@media (max-width: 760px) {
  .ModelHead { gap: 12px; }
  .ModelHead .AvatarHuge { width: 64px; height: 64px; }
  .ModelHead h1 { font-size: 22px; }
}


/* ---------- Objectif du mois ---------- */
.GoalNumbers { font-size: 13px; }
.GoalNumbers strong { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.GoalBar { position: relative; height: 8px; margin: 10px 0 8px; border-radius: 999px; background: var(--Chip); }
.GoalBar i { display: block; height: 100%; border-radius: inherit; background: var(--Good); transition: width 400ms ease; }
.GoalBar.IsBehind i { background: var(--Warn); }
/* Repère : où elle devrait en être à ce stade du mois */
.GoalBar b { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--Ink); }
.GoalMeta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.GoalProjection { margin: 6px 0 0; }
.GoalTools { display: flex; gap: 14px; }
.TextBtn.IsStrong { color: var(--Ink); font-weight: 600; }
/* Montant visé modifié sur place : même police, souligné, sans flèches */
.GoalInput {
  width: 6ch; padding: 0 2px; border: 0; border-bottom: 1px solid var(--Ink); outline: none;
  background: none; color: var(--Ink); font: inherit; font-variant-numeric: tabular-nums; text-align: right;
}
.GoalLine { grid-column: 1 / -1; }
.GoalLine .GoalBar { height: 6px; margin: 6px 0 4px; }
.Status.IsWarnText, .IsWarnText { color: var(--Warn); }

/* ---------- Onglets de la page d'une modèle ---------- */
.TabAlert { display: none; width: 6px; height: 6px; border-radius: 50%; }
.TabAlert.IsWarn { display: inline-block; background: var(--Warn); }
.TabAlert.IsBad { display: inline-block; background: var(--Accent); }

/* ---------- Fiche d'une modèle ---------- */
.ConsentState { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.ConsentState .ToneIcon { margin-top: 2px; }
.ConsentState div { display: grid; }
.ConsentState strong { font-weight: 600; }

.EditList { display: grid; margin: 0 0 12px; padding: 0; list-style: none; }
.EditList li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--Edge); }
.EditList li:last-child { border-bottom: 1px solid var(--Edge); }
.Card .Empty { margin: 0 0 12px; }

/* Bouton retirer : croix discrète, plus visible au survol de la ligne */
.RemoveBtn {
  display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: var(--RadiusInner); background: none; color: var(--Muted); cursor: pointer; opacity: .45; vertical-align: middle;
  transition: opacity var(--Fade), color var(--Fade);
}
.RemoveBtn .Icon { width: 10px; height: 10px; }
li:hover .RemoveBtn, tr:hover .RemoveBtn, .RemovableChip:hover .RemoveBtn, .RemoveBtn:focus-visible { opacity: 1; }
.RemoveBtn:hover { color: var(--Accent); }

.DocumentTable { margin-bottom: 12px; }
.DocumentTable tr:first-child td { border-top: 0; }
.DocumentTable .TextBtn { margin-right: 4px; }

.TeamList { display: grid; gap: 14px; margin: 0; }
.TeamList dt { margin-bottom: 6px; font-size: 12px; color: var(--Muted); }
.TeamList dd { margin: 0; }
.TeamList .Chips { margin-bottom: 8px; }
.RemovableChip { display: inline-flex; align-items: center; gap: 2px; padding-right: 2px; font-size: 13px; }

/* ---------- Documents : vrais fichiers ---------- */
.FileList { display: grid; margin: 0 0 12px; padding: 0; list-style: none; }
.FileList li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto auto auto; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--Edge); }
.FileList li:first-child { border-top: 0; padding-top: 0; }
.FileIcon { display: grid; place-items: center; color: var(--Muted); }
.FileIcon .Icon { width: 16px; height: 16px; }
.FileText { display: grid; min-width: 0; }
.FileName { padding: 0; border: 0; background: none; color: var(--Ink); font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
.FileName:hover { text-decoration: underline; text-underline-offset: 3px; }
.FileStatus {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px;
  border: 0; border-radius: var(--RadiusInner); background: none; cursor: pointer; font-size: 12px; color: var(--Warn); white-space: nowrap;
}
.FileStatus .Icon { width: 12px; height: 12px; }
.FileStatus.IsSigned { color: var(--Good); }
.FileStatus:hover { background: var(--Chip); }
.RemoveBtn.IsVisible { opacity: .8; }
.RemoveBtn.IsConfirm { opacity: 1; color: var(--Accent); }

.DropZone {
  display: flex; align-items: center; gap: 12px; padding: 16px;
  border: 1px dashed var(--Line); border-radius: var(--RadiusControl); cursor: pointer; color: var(--Muted);
  transition: background-color var(--Fade), border-color var(--Fade), color var(--Fade);
}
.DropZone > .Icon { width: 20px; height: 20px; }
.DropZone > span { display: grid; }
.DropZone strong { color: var(--Ink); font-weight: 600; }
.DropZone:hover, .DropZone.IsOver { background: var(--Chip); border-color: var(--Ink); color: var(--Ink); }
[data-file-error] { margin-top: 8px; }
.FileList .RemoveBtn { width: 26px; height: 26px; }
.FileList .RemoveBtn .Icon { width: 14px; height: 14px; }
.ModelHead .ModelHeadText { flex: 1; min-width: 0; }
.ModelActions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 720px) { .ModelHead { flex-wrap: wrap; } .ModelActions { width: 100%; justify-content: flex-start; } }
.BillAction .RemoveBtn { margin-left: 8px; vertical-align: middle; }

/* Réponses au questionnaire et choix de la réponse à importer */
.DialogBox.IsWide { width: min(760px, 100%); }
.Answers { display: grid; gap: 22px; max-height: 64vh; margin: 0 0 14px; padding-right: 6px; overflow: auto; }
.AnswerGroup h3 { margin: 0 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--Muted); }
.AnswerGroup dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 0; }
.AnswerGroup dl > div { display: grid; align-content: start; gap: 4px; min-width: 0; }
.AnswerGroup dl > .IsWide { grid-column: 1 / -1; }
.AnswerGroup dt { font-size: 12px; line-height: 1.35; color: var(--Muted); }
.AnswerGroup dd { margin: 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.AnswerGroup .Chips { white-space: normal; }
.AnswerGroup .Chip { font-size: 12.5px; }
.ChipYes { color: var(--Good); }
.AnswerYes { display: inline-flex; align-items: center; gap: 6px; color: var(--Good); }
.AnswerYes .Icon { width: 14px; height: 14px; }
/* Réponse changée par un nouvel envoi : point devant la question, ancienne valeur dessous */
.AnswerGroup .IsChanged dt { color: var(--Ink); }
.AnswerGroup .IsChanged dt::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 7px 1px 0; border-radius: 50%; background: var(--Ink); }
.AnswerGroup .AnswerBefore { font-size: 12.5px; color: var(--Muted); }
.SendsNote { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font-size: 13px; color: var(--Muted); }
.SendsNote .Icon { width: 14px; height: 14px; }
@media (max-width: 560px) { .AnswerGroup dl { grid-template-columns: minmax(0, 1fr); } }
.PickList { display: grid; gap: 2px; max-height: 50vh; overflow: auto; }
.PickItem { display: flex; align-items: flex-start; gap: 10px; padding: 8px; border-radius: var(--RadiusControl); cursor: pointer; transition: background .15s; }
.PickItem:hover { background: var(--Chip); }
.PickItem input { margin: 3px 0 0; accent-color: var(--Ink); }
.PickItem span { display: grid; }

/* ---------- Points hebdomadaires ---------- */
/* Barre du haut : même retrait que les côtés de la carte, séparée des points par un filet */
.ReportTools { display: flex; justify-content: flex-end; padding: 12px 0 16px; border-bottom: 1px solid var(--Edge); }
.ReportText { white-space: pre-wrap; -webkit-user-select: text; user-select: text; }
.ReportTools .Btn:disabled { opacity: .45; cursor: default; }

/* Supprimer un point : icône discrète, puis « Supprimer ? » en rouge au premier clic */
.Btn.ReportRemove {
  margin-left: auto; height: 28px; min-width: 28px; padding: 0 7px; gap: 6px;
  background: none; color: var(--Muted); opacity: .55;
  transition: opacity var(--Fade), color var(--Fade), background var(--Fade);
}
.Btn.ReportRemove .Icon { width: 14px; height: 14px; }
.ReportRemoveLabel { display: none; font-size: 12px; font-weight: 600; }
.Request:hover .Btn.ReportRemove, .Btn.ReportRemove:focus-visible { opacity: 1; }
.Btn.ReportRemove:hover { color: var(--Ink); background: var(--Chip); }
.Btn.ReportRemove.IsConfirm { opacity: 1; color: var(--AccentInk); background: var(--Accent); }
.Btn.ReportRemove.IsConfirm .ReportRemoveLabel { display: inline; }

/* ---------- Journal ----------
   En haut une carte par associé (cliquable pour filtrer), en dessous les lignes sur toute la largeur. */
.JournalSearch { flex: 0 1 320px; }
.JournalPeople { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.JournalPeople:empty { display: none; }
.JournalPerson {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: start; gap: 12px;
  padding: 14px; cursor: pointer; transition: background-color var(--Fade);
}
.JournalPerson:hover { background: var(--Chip); }
.JournalPerson.IsOn { background: var(--ChipActive); }
.JournalAvatar { position: relative; width: 40px; height: 40px; }
.JournalAvatar .Avatar { width: 40px; height: 40px; }
.JournalOnline {
  position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--Good); box-shadow: 0 0 0 2px var(--PanelSolid);
}
.JournalPerson:hover .JournalOnline { box-shadow: 0 0 0 2px var(--Chip); }
.JournalPerson.IsOn .JournalOnline { box-shadow: 0 0 0 2px var(--ChipActive); }
.JournalPersonText { display: grid; min-width: 0; line-height: 1.4; }
.JournalPersonText strong { font-weight: 600; }
.JournalMain { padding-top: 14px; }
.JournalTop { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 8px; }
.JournalTop .Combo .ComboButton { height: 32px; padding: 0 12px; font-size: 13px; }
.JournalTop .Tabs { margin-bottom: 0; }
.JournalList { transition: opacity var(--Fade); }
.JournalList.IsLoading { opacity: .45; pointer-events: none; }
.JournalCount { flex: none; padding: 1px 6px; border-radius: var(--RadiusInner); background: var(--Chip); color: var(--Muted); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.IsBadText { color: var(--Accent); }
.JournalDay { margin: 14px 8px 4px; font-size: 12px; font-weight: 600; color: var(--Muted); text-transform: capitalize; }
.JournalDay:first-child { margin-top: 0; }
.JournalRow { grid-template-columns: 14px minmax(0, 1fr) minmax(0, max-content) auto; align-items: center; gap: 12px; }
.JournalRow .ToneIcon { margin-top: 0; }
.JournalRow .Small { margin-top: 0; }
.JournalText { display: flex; align-items: center; gap: 6px; min-width: 0; }
.JournalPlace { max-width: 220px; }
.JournalPlace:empty { display: none; }
.JournalMore { justify-content: center; padding-top: 12px; }

/* ---------- Notifications (historique) ---------- */
.NotificationRow.IsUnread .Text { font-weight: 600; }
.NotificationRowDetail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.Request:hover .RemoveBtn { opacity: 1; }
.ContractFile { justify-self: start; max-width: 100%; }
.ContractFile [data-file-name] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
