/* =========================================================
   Le bureau de Marc — tableau de bord interactif
   Marque : corail #E8604C / gris #6B6B6B — fond clair
   ========================================================= */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/inter-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Pacifico';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/pacifico-latin.woff2') format('woff2');
}

:root {
  --coral: #E8604C;
  --coral-clair: #FBE4DF;
  --coral-clair-2: #FBEDE9;
  --coral-fonce: #C9463A;
  --gris: #6B6B6B;
  --gris-clair: #8C8C8C;
  --encre: #2E2A28;
  --fond: #FAF7F5;
  --fond-alt: #FFFFFF;
  --bord: #EDE4DF;
  --bord-fort: #E0D4CD;
  --vert: #2E9E72;
  --vert-clair: #E4F4EC;
  --bleu: #3579BC;
  --bleu-clair: #E6F0F9;
  --violet: #7A57CF;
  --violet-clair: #EFE9FB;
  --ambre: #B6791F;
  --ambre-clair: #FBF0DC;
  --ombre: 0 10px 30px -20px rgba(46, 42, 40, .35);
  --rayon: 16px;
  --max: 1340px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  color: var(--encre);
  background: var(--fond);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }

button { font-family: inherit; }

/* ============ BARRE SUPÉRIEURE ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bord);
}

.topbar__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar__left { display: flex; align-items: center; gap: 12px; }

.topbar__pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--vert);
  box-shadow: 0 0 0 0 rgba(46, 158, 114, .5);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46, 158, 114, .45); }
  70%  { box-shadow: 0 0 0 10px rgba(46, 158, 114, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 158, 114, 0); }
}

.topbar__title {
  font-size: 1.28rem;
  font-weight: 700;
}

.topbar__name {
  font-family: 'Pacifico', cursive;
  font-weight: 400;
  color: var(--coral);
  padding-right: .08em;
}

.topbar__right { display: flex; align-items: center; gap: 18px; }

.topbar__date {
  font-size: .86rem;
  font-weight: 600;
  color: var(--gris);
  text-transform: capitalize;
}

.topbar__brand {
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--coral);
  padding: 7px 14px;
  border: 1px solid var(--coral-clair);
  background: var(--coral-clair-2);
  border-radius: 999px;
  white-space: nowrap;
}

/* ============ BARRE D'ÉTAT DES AGENTS ============ */
.statusbar {
  background: #fff;
  border-bottom: 1px solid var(--bord);
}

.statusbar__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 28px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.agentchip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--bord);
  border-radius: 14px;
  background: var(--fond-alt);
  transition: border-color .2s ease, transform .2s ease;
}

.agentchip:hover { border-color: var(--bord-fort); transform: translateY(-1px); }

.agentchip__avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  flex: none;
  background: var(--coral-clair-2);
}

.agentchip__avatar img { width: 100%; height: 100%; object-fit: cover; }

.agentchip__info { min-width: 0; flex: 1; }

.agentchip__name {
  font-size: .84rem;
  font-weight: 700;
  color: var(--encre);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agentchip__name em {
  font-style: normal;
  font-family: 'Pacifico', cursive;
  color: var(--coral);
  font-size: .96rem;
}

.agentchip__role {
  font-size: .7rem;
  color: var(--gris);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agentchip__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: none;
}

.agentchip__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--vert);
  background: var(--vert-clair);
  padding: 3px 8px;
  border-radius: 999px;
}

.agentchip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--vert);
}

.agentchip__count {
  font-size: .72rem;
  font-weight: 700;
  color: var(--gris);
}

.agentchip__count b { color: var(--coral); font-size: .86rem; }

/* ============ BUREAU ============ */
.desk {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.desk__col { display: grid; gap: 24px; }

/* ============ PANNEAUX ============ */
.panel {
  background: var(--fond-alt);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  overflow: hidden;
}

.panel__head {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--bord);
  background: linear-gradient(180deg, #fff, var(--coral-clair-2));
}

.panel--miroir .panel__head { background: linear-gradient(180deg, #fff, var(--bleu-clair)); }
.panel--rediger .panel__head { background: linear-gradient(180deg, #fff, var(--vert-clair)); }

.panel__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.panel__heading h2 {
  font-size: 1.16rem;
  font-weight: 800;
}

.panel__agent {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-right: 12px;
  border-right: 1px solid var(--bord-fort);
}

.panel__agent img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--coral-clair-2);
}

.panel__agentname {
  font-family: 'Pacifico', cursive;
  font-size: 1.02rem;
  color: var(--coral);
}

.count {
  margin-left: auto;
  min-width: 30px;
  padding: 3px 10px;
  text-align: center;
  font-size: .8rem;
  font-weight: 800;
  color: #fff;
  background: var(--coral);
  border-radius: 999px;
}

.panel--miroir .count { background: var(--bleu); }
.panel--rediger .count { background: var(--vert); }

.panel__intro {
  margin-top: 8px;
  font-size: .84rem;
  color: var(--gris);
}

.panel__body { padding: 18px 22px 22px; display: grid; gap: 14px; }

.panel__reminder {
  padding: 12px 22px 18px;
  font-size: .8rem;
  color: var(--gris);
  font-style: italic;
  border-top: 1px dashed var(--bord);
}

.empty {
  padding: 18px;
  text-align: center;
  font-size: .88rem;
  color: var(--gris-clair);
  border: 1px dashed var(--bord-fort);
  border-radius: 12px;
  background: var(--fond);
}

/* ============ CARTES SUJETS ============ */
.sujet {
  position: relative;
  padding: 18px 18px 16px;
  border: 1px solid var(--bord);
  border-radius: 14px;
  background: var(--fond-alt);
  transition: opacity .4s ease, transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  animation: pop .35s ease both;
}

.sujet:hover { box-shadow: var(--ombre); border-color: var(--bord-fort); transform: translateY(-2px); }

.sujet.is-passed {
  opacity: .38;
  filter: grayscale(.4);
  pointer-events: none;
}

.sujet.is-moving { transform: translateX(14px); opacity: 0; }

@keyframes pop {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sujet__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

.tag {
  font-size: .68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--coral-clair-2);
  color: var(--coral-fonce);
  white-space: nowrap;
}

.sujet h3 {
  font-size: 1.04rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.sujet__angle {
  font-size: .88rem;
  color: var(--gris);
  margin-bottom: 8px;
}

.sujet__angle strong { color: var(--encre); font-weight: 600; }

.sujet__accroche {
  font-size: .88rem;
  font-style: italic;
  color: var(--coral-fonce);
  padding-left: 12px;
  border-left: 3px solid var(--coral-clair);
  margin-bottom: 12px;
}

.sujet__source {
  font-size: .76rem;
  color: var(--gris-clair);
  margin-bottom: 14px;
}

.sujet__source a { color: var(--gris); text-decoration: underline; text-underline-offset: 2px; }
.sujet__source a:hover { color: var(--coral); }

.sujet__actions { display: flex; gap: 10px; }

/* ============ BOUTONS ============ */
.btn {
  font-size: .84rem;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease, border-color .2s ease, color .2s ease;
}

.btn:active { transform: scale(.98); }

.btn--valider { background: var(--coral); color: #fff; }
.btn--valider:hover { background: var(--coral-fonce); }

.btn--passer { background: #fff; color: var(--gris); border-color: var(--bord-fort); }
.btn--passer:hover { color: var(--coral); border-color: var(--coral); }

.btn--copier { background: var(--bleu); color: #fff; }
.btn--copier:hover { background: #2b639b; }

.btn--reveal {
  background: var(--bleu-clair);
  color: #245a8f;
  width: 100%;
  text-align: left;
}
.btn--reveal:hover { background: #d6e6f5; }

/* ============ CARTES À RÉDIGER ============ */
.redige {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--bord);
  border-left: 3px solid var(--vert);
  border-radius: 12px;
  background: #fff;
  animation: pop .35s ease both;
}

.redige__check {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--vert-clair);
  color: var(--vert);
  font-size: .74rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.redige__body h3 { font-size: .95rem; font-weight: 700; margin-bottom: 4px; }
.redige__body p { font-size: .8rem; color: var(--gris); }
.redige__tags { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ============ VEILLE ============ */
.veille {
  display: flex;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--bord);
  border-radius: 12px;
  background: #fff;
  transition: border-color .2s ease, transform .2s ease;
  animation: pop .35s ease both;
}

.veille:hover { border-color: var(--bord-fort); transform: translateX(3px); }

.veille__body { min-width: 0; flex: 1; }

.veille__top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.veille__source {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--gris);
  text-transform: uppercase;
}

.veille__time { font-size: .7rem; color: var(--gris-clair); margin-left: auto; }

.veille h3 { font-size: .88rem; font-weight: 600; line-height: 1.35; }

.veille a { color: var(--encre); text-decoration: none; }
.veille a:hover { color: var(--coral); }

.veille__link {
  display: inline-block;
  margin-top: 6px;
  font-size: .74rem;
  font-weight: 700;
  color: var(--coral);
  text-decoration: none;
}
.veille__link:hover { text-decoration: underline; }

.badge-new {
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--coral-fonce);
  background: var(--coral-clair);
  padding: 2px 7px;
  border-radius: 999px;
}

/* Tags colorés veille */
.tagcat {
  font-size: .64rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.tagcat--concurrence { background: var(--coral-clair-2); color: var(--coral-fonce); }
.tagcat--sourcing     { background: var(--vert-clair); color: #1f7a55; }
.tagcat--geo          { background: var(--bleu-clair); color: #245a8f; }
.tagcat--reglementaire{ background: var(--violet-clair); color: #5b3aa5; }

/* ============ MESSAGES ============ */
.message {
  border: 1px solid var(--bord);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  transition: border-color .3s ease;
  animation: pop .35s ease both;
}

.message.is-repondu { border-color: #cfe9dc; background: #fbfefc; }

.message__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 16px 12px;
}

.message__avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--coral-clair-2);
  color: var(--coral-fonce);
  font-weight: 800;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message__id { flex: 1; min-width: 0; }
.message__name { font-size: .9rem; font-weight: 700; }
.message__role { font-size: .76rem; color: var(--gris); }

.message__badges { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }

.score {
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}
.score--chaud { background: #FBE0DC; color: #B23A2C; }
.score--tiede { background: var(--ambre-clair); color: var(--ambre); }

.statut-repondu {
  font-size: .64rem;
  font-weight: 700;
  color: var(--vert);
  background: var(--vert-clair);
  padding: 3px 8px;
  border-radius: 999px;
}

.message__text {
  margin: 0 16px 14px;
  padding: 12px 14px;
  font-size: .86rem;
  color: var(--encre);
  background: var(--fond);
  border-radius: 10px;
  border-left: 3px solid var(--bord-fort);
}

.message__replybox {
  margin: 0 16px;
  padding: 12px 14px;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--encre);
  background: var(--coral-clair-2);
  border: 1px dashed var(--coral-clair);
  border-radius: 10px;
  white-space: pre-wrap;
  font-family: inherit;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
  transition: max-height .4s ease, opacity .3s ease, padding .3s ease, margin .3s ease;
}

.message.is-open .message__replybox {
  max-height: 640px;
  opacity: 1;
  padding-top: 12px;
  padding-bottom: 12px;
  margin-top: 2px;
  margin-bottom: 12px;
}

.message__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 16px;
  flex-wrap: wrap;
}

.message__toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: .78rem;
  font-weight: 700;
  color: var(--coral);
  cursor: pointer;
}
.message__toggle:hover { text-decoration: underline; }

/* ============ MIROIR ============ */
.alerte {
  border: 1px solid var(--bord);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  animation: pop .35s ease both;
}

.alerte__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  flex-wrap: wrap;
}

.alerte__moteur {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bleu-clair);
  color: #245a8f;
  white-space: nowrap;
}

.alerte__etat {
  font-size: .64rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.alerte__etat--nouveau { background: var(--coral-clair); color: var(--coral-fonce); }
.alerte__etat--inchange { background: #EFEFEF; color: var(--gris); }
.alerte__etat--corriger { background: var(--ambre-clair); color: var(--ambre); }

.alerte__date { font-size: .72rem; color: var(--gris-clair); margin-left: auto; }

.alerte__texte {
  padding: 0 16px 14px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--encre);
}

.alerte__reveal {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 16px;
  transition: max-height .4s ease, opacity .3s ease, padding .3s ease;
}

.alerte.is-open .alerte__reveal {
  max-height: 420px;
  opacity: 1;
  padding-bottom: 6px;
}

.alerte__extrait {
  font-size: .82rem;
  color: var(--encre);
  background: var(--fond);
  border-left: 3px solid var(--bleu);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  white-space: pre-wrap;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  line-height: 1.5;
}

.alerte__foot { padding: 0 16px 16px; }

/* ============ FOOTER ============ */
.footer {
  margin-top: 12px;
  padding: 34px 24px;
  text-align: center;
  border-top: 1px solid var(--bord);
  background: #fff;
}
.footer p { font-size: .82rem; color: var(--gris); }

/* ============ TOAST ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 24px);
  z-index: 90;
  padding: 13px 22px;
  font-size: .86rem;
  font-weight: 600;
  color: #fff;
  background: var(--encre);
  border-radius: 12px;
  box-shadow: 0 18px 40px -14px rgba(46, 42, 40, .6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  max-width: calc(100vw - 40px);
  text-align: center;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-coral { background: var(--coral); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1080px) {
  .statusbar__inner { grid-template-columns: repeat(2, 1fr); }
  .desk { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar__inner { padding: 14px 18px; flex-wrap: wrap; }
  .topbar__title { font-size: 1.1rem; }
  .topbar__right { gap: 10px; }
  .topbar__brand { display: none; }
  .statusbar__inner { grid-template-columns: 1fr; padding: 12px 18px; }
  .desk { padding: 18px; gap: 18px; }
  .panel__head { padding: 16px 16px 14px; }
  .panel__body { padding: 14px 16px 18px; }
  .sujet__actions { flex-direction: column; }
  .sujet__actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
