/* ============================================================
   CHATTER STATS — style.css
   Modifie les variables :root pour changer les couleurs globales
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ── Variables globales ── */
:root {
  /* Fonds */
  --bg:      #0d0f14;
  --bg2:     #13161d;
  --bg3:     #1a1e28;
  --card:    #1e2330;

  /* Bordures */
  --border:  rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);

  /* Texte */
  --text:    #e8eaf0;
  --muted:   #7a7f94;

  /* Couleurs accent */
  --accent:  #7c6ef5;
  --accent2: #a399f7;

  /* Couleurs métriques */
  --green:   #4ade80;
  --amber:   #fbbf24;
  --red:     #f87171;
  --pink:    #f472b6;
  --blue:    #60a5fa;
  --cyan:    #22d3ee;

  /* Layout */
  --radius:    12px;
  --radius-sm: 8px;
}

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* ── Vues ── */
.view { display: none; min-height: 100vh; }
.view.active { display: flex; flex-direction: column; }

/* ============================================================
   LOGIN
   ============================================================ */
#view-login {
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #1a1535 0%, var(--bg) 60%);
}
.login-box {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 44px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.logo { font-size: 22px; font-weight: 600; letter-spacing: -0.5px; margin-bottom: 6px; }
.logo span { color: var(--accent); }
.login-subtitle { color: var(--muted); font-size: 13px; margin-bottom: 32px; }
/* login-tabs supprimé — connexion unifiée */
.input-group { margin-bottom: 14px; text-align: left; }
.input-group label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 6px; }
.input-group input {
  width: 100%; padding: 10px 14px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: inherit; font-size: 14px; outline: none;
  transition: border-color .2s;
}
.input-group input:focus { border-color: var(--accent); }
.btn-primary {
  width: 100%; padding: 11px;
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); font-family: inherit;
  font-size: 14px; font-weight: 500; cursor: pointer;
  margin-top: 8px; transition: opacity .2s;
}
.btn-primary:hover { opacity: .88; }
.error-msg { color: var(--red); font-size: 12px; margin-top: 10px; min-height: 18px; }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.topbar-logo { font-size: 16px; font-weight: 600; }
.topbar-logo span { color: var(--accent); }
.badge {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 12px; font-size: 12px; color: var(--muted);
}
.badge.admin {
  color: var(--accent2);
  border-color: rgba(124,110,245,.3);
  background: rgba(124,110,245,.08);
}
.badge.manager {
  color: #22c55e;
  border-color: rgba(34,197,94,.3);
  background: rgba(34,197,94,.08);
}
.btn-logout {
  background: transparent; border: 1px solid var(--border2); color: var(--muted);
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; cursor: pointer; transition: all .2s;
}
.btn-logout:hover { color: var(--text); }

/* ============================================================
   LAYOUT
   ============================================================ */
.page-content { padding: 28px; max-width: 1200px; margin: 0 auto; width: 100%; }
.page-hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; flex-wrap: wrap; gap: 10px;
}
.page-hdr h2 { font-size: 17px; font-weight: 600; }
.page-hdr p { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  overflow-x: auto;
}
.tab-btn {
  padding: 10px 18px; border: none; background: transparent; color: var(--muted);
  font-family: inherit; font-size: 14px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all .2s; white-space: nowrap;
}
.tab-btn.active { color: var(--accent2); border-bottom-color: var(--accent); }
.tab-btn:hover:not(.active) { color: var(--text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   CARDS
   ============================================================ */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.card-head {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-head h3 { font-size: 13px; font-weight: 500; }
.card-body { padding: 18px; }

/* ============================================================
   METRIC CARDS
   ============================================================ */
.metrics-row { display: grid; gap: 12px; margin-bottom: 16px; }
.g5 { grid-template-columns: repeat(5, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) {
  .g5, .g4 { grid-template-columns: repeat(3, 1fr); }
  .g3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .g5, .g4, .g3 { grid-template-columns: repeat(2, 1fr); }
}
.mc {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 16px;
  position: relative; overflow: hidden;
}
.mc::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
}
/* Couleur de la barre top — une ligne par couleur */
.t-green::before  { background: var(--green);  }
.t-purple::before { background: var(--accent); }
.t-amber::before  { background: var(--amber);  }
.t-pink::before   { background: var(--pink);   }
.t-blue::before   { background: var(--blue);   }
.t-cyan::before   { background: var(--cyan);   }
.t-red::before    { background: var(--red);    }

.mc-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 7px; }
.mc-val { font-size: 22px; font-weight: 600; font-family: 'DM Sans', sans-serif; letter-spacing: -0.5px; }
.mc-val.green  { color: var(--green);   }
.mc-val.purple { color: var(--accent2); }
.mc-val.amber  { color: var(--amber);   }
.mc-val.pink   { color: var(--pink);    }
.mc-val.blue   { color: var(--blue);    }
.mc-val.cyan   { color: var(--cyan);    }
.mc-unit { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.mc-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ============================================================
   CHARTS
   ============================================================ */
.chart-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px;
}
.chart-title { font-size: 13px; font-weight: 500; margin-bottom: 12px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 10px; font-weight: 500;
  color: var(--muted); text-transform: uppercase; letter-spacing: .5px;
  padding: 9px 14px; border-bottom: 1px solid var(--border);
  background: var(--bg3); white-space: nowrap;
}
td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 12px; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
.sn { font-family: 'DM Mono', monospace; font-size: 12px; }
.clickrow { cursor: pointer; transition: background .15s; }
.clickrow:hover td { background: rgba(124,110,245,.05) !important; }

/* ============================================================
   DIAGNOSTIC
   ============================================================ */
.diag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.diag-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.diag-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.diag-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(124,110,245,.15); color: var(--accent2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.diag-name { font-size: 13px; font-weight: 500; }
.diag-score { font-size: 11px; margin-top: 1px; }
.diag-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.diag-row:last-child { border-bottom: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dg { background: var(--green); box-shadow: 0 0 5px rgba(74,222,128,.5); }
.da { background: var(--amber); box-shadow: 0 0 5px rgba(251,191,36,.5); }
.dr { background: var(--red);   box-shadow: 0 0 5px rgba(248,113,113,.5); }
.d-metric { flex: 1; font-size: 11px; color: var(--muted); }
.d-val { font-family: 'DM Mono', monospace; font-size: 11px; }
.d-diff { font-size: 10px; margin-left: 4px; }

/* ============================================================
   RADAR
   ============================================================ */
.radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.radar-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.radar-name { font-size: 13px; font-weight: 500; text-align: center; margin-bottom: 8px; }

/* ============================================================
   FEEDBACK ADMIN
   ============================================================ */
.feedback-banner {
  background: rgba(124,110,245,.08);
  border: 1px solid rgba(124,110,245,.2);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px;
}
.feedback-from { font-size: 10px; color: var(--accent2); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px; }
.feedback-body { font-size: 13px; line-height: 1.7; }
.comment-ta {
  width: 100%; padding: 11px 13px;
  background: var(--bg); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: inherit; font-size: 13px; outline: none;
  resize: vertical; min-height: 80px; transition: border-color .2s;
}
.comment-ta:focus { border-color: var(--accent); }
.btn-save {
  padding: 8px 18px; background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); font-family: inherit; font-size: 13px;
  cursor: pointer; margin-top: 8px;
}
.btn-save:hover { opacity: .88; }

/* ============================================================
   IMPORT
   ============================================================ */
.import-zone {
  border: 1.5px dashed var(--border2); border-radius: var(--radius);
  padding: 34px; text-align: center; cursor: pointer;
  transition: all .2s; background: var(--bg2); margin-bottom: 22px;
}
.import-zone:hover, .import-zone.drag {
  border-color: var(--accent); background: rgba(124,110,245,.04);
}
.import-zone input[type=file] { display: none; }
.col-map { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; align-items: center; }
.col-map label { font-size: 12px; color: var(--muted); }
select.sm, .week-date-input {
  padding: 7px 10px; background: var(--bg3);
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  color: var(--text); font-family: inherit; font-size: 13px;
  outline: none; cursor: pointer;
}
select.sm:focus, .week-date-input:focus { border-color: var(--accent); }
.count-badge {
  background: rgba(124,110,245,.15); color: var(--accent2);
  border-radius: 20px; padding: 2px 10px; font-size: 12px;
}
.btn-confirm {
  padding: 10px 24px; background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); font-family: inherit;
  font-size: 14px; font-weight: 500; cursor: pointer; margin-top: 2px;
}
.weeks-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px; margin-bottom: 20px;
}
.section-sep {
  font-size: 15px; font-weight: 600;
  margin: 28px 0 14px; padding-top: 24px;
  border-top: 1px solid var(--border);
}
.btn-del { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 3px; transition: color .2s; }
.btn-del:hover { color: var(--red); }

/* ============================================================
   SETTINGS
   ============================================================ */
.chatters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.chatter-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; position: relative; }
.ch-name { font-size: 13px; font-weight: 500; margin-bottom: 5px; padding-right: 18px; }
.ch-code {
  font-family: 'DM Mono', monospace; font-size: 11px;
  color: var(--accent2); background: rgba(124,110,245,.1);
  padding: 2px 7px; border-radius: 4px; display: inline-block;
}
.ch-role-badge {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 4px;
  display: inline-block; margin-left: 6px; text-transform: uppercase; letter-spacing: .4px;
}
.ch-role-chatter { color: var(--accent2); background: rgba(124,110,245,.1); }
.ch-role-manager { color: #22c55e; background: rgba(34,197,94,.1); }
.add-row { display: flex; gap: 10px; margin-bottom: 18px; }
.add-row input {
  flex: 1; padding: 9px 13px; background: var(--bg3);
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  color: var(--text); font-family: inherit; font-size: 14px; outline: none;
}
.add-row input:focus { border-color: var(--accent); }
.btn-add {
  padding: 9px 18px; background: var(--bg3); border: 1px solid var(--border2);
  color: var(--text); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; cursor: pointer;
  transition: all .2s; white-space: nowrap;
}
.btn-add:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ============================================================
   DIVERS
   ============================================================ */
.mini-av {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(124,110,245,.12); color: var(--accent2);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; flex-shrink: 0;
}
.trend-up { color: var(--green); font-size: 11px; }
.trend-dn { color: var(--red);   font-size: 11px; }
.trend-fl { color: var(--muted); font-size: 11px; }
.bar-bg { flex: 1; height: 4px; background: var(--bg3); border-radius: 2px; overflow: hidden; min-width: 40px; }
.bar-fill { height: 100%; border-radius: 2px; }
.bg { background: var(--green); }
.bp { background: var(--accent); }
.ba { background: var(--amber); }
.back-btn {
  background: transparent; border: 1px solid var(--border2); color: var(--muted);
  padding: 7px 14px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; cursor: pointer;
  margin-bottom: 18px; display: inline-flex; align-items: center;
  gap: 5px; transition: color .2s;
}
.back-btn:hover { color: var(--text); }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }

/* ── Toast ── */
#toast {
  position: fixed; bottom: 22px; right: 22px;
  background: var(--card); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: 11px 16px;
  font-size: 13px; display: none; z-index: 9999;
  box-shadow: 0 8px 28px rgba(0,0,0,.4);
}
#toast.show { display: block; }
#toast.ok  { border-color: rgba(74,222,128,.3); color: var(--green); }
#toast.err { border-color: rgba(248,113,113,.3); color: var(--red);  }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }

/* ============================================================
   COACHING — Cadre de conseils automatiques
   ============================================================ */
#cd-coaching {
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  background: var(--card);
  overflow: hidden;
  margin-bottom: 18px;
}

.coaching-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.coaching-icon { font-size: 18px; }
.coaching-header-text { display: flex; flex-direction: column; gap: 1px; }
.coaching-title    { font-size: 14px; font-weight: 600; color: var(--text); }
.coaching-subtitle { font-size: 11px; color: var(--muted); }

.coaching-list { display: flex; flex-direction: column; }

/* ── Conseil individuel ── */
.coaching-tip {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  transition: background .15s;
}
.coaching-tip:last-child { border-bottom: none; }

/* Urgent — rouge */
.tip-urgent {
  border-left-color: var(--red);
  background: rgba(248, 113, 113, 0.04);
}
.tip-urgent:hover { background: rgba(248, 113, 113, 0.07); }

/* Warning — orange/amber */
.tip-warning {
  border-left-color: var(--amber);
  background: rgba(251, 191, 36, 0.04);
}
.tip-warning:hover { background: rgba(251, 191, 36, 0.07); }

/* Ligne du haut : badge + titre */
.tip-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  flex-wrap: wrap;
}
.tip-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .3px;
  white-space: nowrap;
}
.badge-urgent {
  background: rgba(248, 113, 113, 0.15);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.3);
}
.badge-warning {
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber);
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.tip-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* Message */
.tip-message {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 9px;
}

/* Bloc conseil concret */
.tip-action {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 12px;
}
.tip-action-lbl {
  color: var(--accent2);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.tip-action-txt { color: var(--text); line-height: 1.5; }

/* ============================================================
   ADMIN COACHING — Vue conseils équipe (onglet Diagnostic)
   ============================================================ */

/* Label de section */
.section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* Barre de résumé */
.admin-coaching-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.acb-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  flex: 1;
  min-width: 160px;
}
.acb-num {
  font-family: 'DM Mono', monospace;
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
}
.acb-lbl {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}
.acb-urgent  { background: rgba(248,113,113,.06); border-color: rgba(248,113,113,.2); }
.acb-urgent  .acb-num { color: var(--red); }
.acb-warning { background: rgba(251,191,36,.06);  border-color: rgba(251,191,36,.2); }
.acb-warning .acb-num { color: var(--amber); }
.acb-ok      { background: rgba(74,222,128,.06);  border-color: rgba(74,222,128,.2); }
.acb-ok      .acb-num { color: var(--green); }

/* Grille des cartes chatteur */
.admin-coaching-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

/* Carte par chatteur */
.acc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.acc-has-urgent  { border-left-color: var(--red); }
.acc-has-warning { border-left-color: var(--amber); }

.acc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: default;
}
.acc-header-info { flex: 1; }
.acc-name  { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.acc-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: .3px;
}

/* Toggle bouton */
.acc-toggle {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--muted);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
.acc-toggle:hover { color: var(--text); background: var(--bg3); }

/* Corps de la carte (conseils) */
.acc-body {
  border-top: 1px solid var(--border);
}
.acc-tip {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  border-left: 2px solid transparent;
}
.acc-tip:last-child { border-bottom: none; }
.acc-tip-urgent  { border-left-color: var(--red);   background: rgba(248,113,113,.03); }
.acc-tip-warning { border-left-color: var(--amber);  background: rgba(251,191,36,.03); }

.acc-tip-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}
.acc-tip-msg {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 6px;
}
.acc-tip-action {
  font-size: 11px;
  color: var(--accent2);
  background: var(--bg3);
  border-radius: 4px;
  padding: 5px 8px;
  line-height: 1.4;
}

/* ============================================================
   SUIVI DES ERREURS
   ============================================================ */

/* Bouton refresh */
.btn-refresh {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--muted);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}
.btn-refresh:hover { color: var(--text); border-color: var(--accent); }

/* Légende */
.err-legend {
  display: flex;
  gap: 18px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.err-legend span { display: flex; align-items: center; gap: 5px; }

/* Icônes de statut */
.err-icon { font-size: 12px; line-height: 1; }
.err-icon-urgent  { color: var(--red);   }
.err-icon-warning { color: var(--amber); }
.err-icon-ok      { color: var(--green); }
.err-icon-absent  { color: var(--muted); font-size: 16px; }

/* ── Grille principale ── */
.err-grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 700px;
}
.err-chatter-head {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 14px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  min-width: 160px;
  position: sticky;
  left: 0;
  z-index: 2;
}
.err-metric-head {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 6px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.err-grid-week {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  padding: 4px 2px;
  min-width: 28px;
}

/* Cellule nom de chatteur */
.err-chatter-name {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  position: sticky;
  left: 0;
  z-index: 1;
  white-space: nowrap;
  height: 44px;
}
.err-name-alert { background: rgba(248,113,113,.04); }

/* Tag récurrent */
.recurring-tag {
  font-size: 10px;
  font-weight: 600;
  background: rgba(248,113,113,.15);
  color: var(--red);
  border: 1px solid rgba(248,113,113,.3);
  border-radius: 20px;
  padding: 2px 7px;
  white-space: nowrap;
}

/* Groupe de métrique par colonne */
.err-metric-group {
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  vertical-align: middle;
  text-align: center;
  white-space: nowrap;
  height: 44px;
}
.err-cell-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.err-streak-inline {
  font-size: 9px;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
}

/* Pastilles erreurs */
.err-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  margin: 0 2px;
}
.err-dot-urgent  { background: rgba(248,113,113,.2); }
.err-dot-warning { background: rgba(251,191,36,.15); }
.err-dot-ok      { background: rgba(74,222,128,.12); }
.err-dot-absent  { background: transparent; }

/* Badge streak */
.streak-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 20px;
  white-space: nowrap;
}
.streak-danger {
  background: rgba(248,113,113,.2);
  color: var(--red);
  border: 1px solid rgba(248,113,113,.35);
}
.streak-warn {
  background: rgba(251,191,36,.15);
  color: var(--amber);
  border: 1px solid rgba(251,191,36,.3);
}

/* ── Cartes récurrences ── */
.err-rec-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.err-rec-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  flex-wrap: wrap;
}
.err-rec-info { flex: 1; min-width: 0; }
.err-rec-name { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.err-rec-issues { display: flex; flex-wrap: wrap; gap: 6px; }
.err-issue-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 20px;
}
.tag-urgent  { background: rgba(248,113,113,.15); color: var(--red);   border: 1px solid rgba(248,113,113,.3); }
.tag-warning { background: rgba(251,191,36,.12);  color: var(--amber); border: 1px solid rgba(251,191,36,.3); }

.err-rec-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.btn-warn-open {
  padding: 7px 14px;
  background: rgba(248,113,113,.1);
  border: 1px solid rgba(248,113,113,.3);
  color: var(--red);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.btn-warn-open:hover { background: rgba(248,113,113,.2); }

.warn-count-badge {
  font-size: 11px;
  background: rgba(251,191,36,.12);
  color: var(--amber);
  border: 1px solid rgba(251,191,36,.3);
  border-radius: 20px;
  padding: 3px 9px;
  white-space: nowrap;
}

.err-last-warn {
  padding: 8px 16px;
  background: var(--bg3);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

/* ── Journal ── */
.warn-log-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.warn-log-row:last-child { border-bottom: none; }

/* ── Modal ── */
.warn-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.warn-modal-box {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.warn-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   SETTINGS — Sélecteur de langue
   ============================================================ */
.settings-section { margin-bottom: 20px; }
.settings-section-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}
.lang-selector-wrap { display: flex; align-items: center; gap: 12px; }
.lang-select { font-size: 14px; padding: 9px 14px; min-width: 160px; }
.settings-sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* ============================================================
   CALENDRIER — Jours off
   ============================================================ */

/* Navigation */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cal-month-label { font-size: 14px; font-weight: 600; text-transform: capitalize; }
.cal-nav-btn {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--muted);
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.cal-nav-btn:hover { color: var(--text); border-color: var(--accent); }

/* Légende */
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 12px;
  align-items: center;
}
.cal-legend span { display: flex; align-items: center; gap: 5px; }
.cal-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.cal-dot-available { background: var(--accent); }
.cal-dot-pending   { background: var(--amber); }
.cal-dot-approved  { background: var(--green); }
.cal-dot-rejected  { background: var(--red); }
.cal-dot-toolate   { background: var(--bg3); border: 1px solid var(--border2); }

/* Grille */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-grid-admin { gap: 4px; }

.cal-day-hdr {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  padding: 4px 0 8px;
}

/* Cellules */
.cal-cell {
  border-radius: 6px;
  min-height: 40px;
  padding: 4px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.cal-empty { background: transparent; }
.cal-past  { opacity: .35; }
.cal-today .cal-day-num {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
}

/* États de cellule */
.cal-available {
  background: rgba(124,110,245,.08);
  border: 1px solid rgba(124,110,245,.2);
  cursor: pointer;
  transition: background .15s;
}
.cal-available:hover { background: rgba(124,110,245,.18); }
.cal-toolate {
  background: var(--bg3);
  border: 1px solid var(--border);
  opacity: .5;
}
.cal-req-pending  { background: rgba(251,191,36,.1);  border: 1px solid rgba(251,191,36,.3); }
.cal-req-approved { background: rgba(74,222,128,.1);  border: 1px solid rgba(74,222,128,.3); }
.cal-req-rejected { background: rgba(248,113,113,.08);border: 1px solid rgba(248,113,113,.2); }
.cal-has-data     { background: var(--bg3); border: 1px solid var(--border2); }

.cal-day-num {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 2px;
}

/* Badge statut sur cellule */
.cal-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 10px;
  white-space: nowrap;
}
.cal-badge-pending  { background: rgba(251,191,36,.2);  color: var(--amber); }
.cal-badge-approved { background: rgba(74,222,128,.2);  color: var(--green); }
.cal-badge-rejected { background: rgba(248,113,113,.15);color: var(--red); }

/* Noms dans calendrier admin */
.cal-name {
  font-size: 9px;
  font-weight: 500;
  border-radius: 3px;
  padding: 1px 4px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.cal-name-approved { background: rgba(74,222,128,.15);  color: var(--green); }
.cal-name-pending  { background: rgba(251,191,36,.15);  color: var(--amber); }

/* ── Liste des demandes chatteur ── */
.dayoff-req-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.dayoff-req-row:last-child { border-bottom: none; }
.dayoff-req-date { font-size: 13px; font-weight: 500; min-width: 80px; }
.dayoff-note { font-size: 11px; color: var(--muted); width: 100%; padding-left: 0; margin-top: 2px; }

.dayoff-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
}
.dayoff-status-pending  { background: rgba(251,191,36,.12);  color: var(--amber); border: 1px solid rgba(251,191,36,.3); }
.dayoff-status-approved { background: rgba(74,222,128,.12);  color: var(--green); border: 1px solid rgba(74,222,128,.3); }
.dayoff-status-rejected { background: rgba(248,113,113,.1);  color: var(--red);   border: 1px solid rgba(248,113,113,.25); }

.dayoff-cancel-btn {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.dayoff-cancel-btn:hover { color: var(--red); border-color: rgba(248,113,113,.4); }

/* ── Demandes admin ── */
.dayoff-admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.dayoff-admin-row:last-child { border-bottom: none; }
.dayoff-admin-info { flex: 1; min-width: 120px; }
.dayoff-admin-name { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.dayoff-admin-date { font-size: 12px; color: var(--muted); }
.dayoff-admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dayoff-note-input {
  padding: 6px 10px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  outline: none;
  width: 160px;
}
.dayoff-note-input:focus { border-color: var(--accent); }

.btn-approve {
  padding: 6px 14px;
  background: rgba(74,222,128,.1);
  border: 1px solid rgba(74,222,128,.3);
  color: var(--green);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn-approve:hover { background: rgba(74,222,128,.2); }

.btn-reject {
  padding: 6px 14px;
  background: rgba(248,113,113,.08);
  border: 1px solid rgba(248,113,113,.25);
  color: var(--red);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn-reject:hover { background: rgba(248,113,113,.18); }

/* ============================================================
   SETTINGS — Toggle switch modules
   ============================================================ */
.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0;
}
.toggle-switch {
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-track {
  display: block;
  width: 42px;
  height: 24px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 12px;
  transition: background .2s, border-color .2s;
  position: relative;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform .2s, background .2s;
}
.toggle-switch input:checked + .toggle-track {
  background: rgba(124,110,245,.25);
  border-color: var(--accent);
}
.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(18px);
  background: var(--accent);
}

/* ============================================================
   SYSTÈME DE POINTS
   ============================================================ */

/* Héros score chatteur */
.pts-hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  text-align: center;
}
.pts-hero-tier { font-size: 13px; font-weight: 600; margin-bottom: 6px; letter-spacing: .5px; }
.pts-hero-score { font-size: 42px; font-weight: 700; letter-spacing: -2px; color: var(--text); margin-bottom: 14px; }
.pts-hero-next { font-size: 13px; color: var(--muted); }
.pts-hero-next strong { color: var(--text); }

/* Barre de progression */
.pts-progress-wrap { display: flex; align-items: center; gap: 8px; }
.pts-progress-bar { flex: 1; height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.pts-progress-fill { height: 100%; border-radius: 3px; transition: width .4s; }
.pts-progress-lbl { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* Paliers */
.pts-tier-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  position: relative;
  transition: all .2s;
}
.pts-tier-reached { border-color: var(--border2); }
.pts-tier-locked  { opacity: .45; }
.pts-tier-current { box-shadow: 0 0 0 2px var(--accent); }
.pts-tier-icon  { font-size: 24px; margin-bottom: 6px; }
.pts-tier-name  { font-size: 13px; font-weight: 600; }
.pts-tier-min   { font-size: 11px; margin-top: 2px; }
.pts-tier-cur-tag {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  font-size: 9px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px; white-space: nowrap;
}

/* Badge palier dans le tableau */
.pts-tier-badge {
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
  border: 1px solid;
  white-space: nowrap;
}

/* Valeurs points */
.pts-total { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 600; }
.pts-pos   { color: var(--green); }
.pts-neg   { color: var(--red); }

/* Historique */
.pts-week-block { margin-bottom: 14px; }
.pts-week-label {
  font-size: 12px; font-weight: 600;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px;
  margin-bottom: 6px;
}
.pts-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.pts-entry:last-child { border-bottom: none; }
.pts-entry-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.pts-entry-label { flex: 1; color: var(--muted); }
.pts-entry-val { font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 600; white-space: nowrap; }

/* Règles */
.pts-rule-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.pts-rule-row:last-child { border-bottom: none; }

/* ============================================================
   SETTINGS — Éditeur de messages de conseil
   ============================================================ */
.coaching-field-group {
  margin-bottom: 14px;
}
.coaching-field-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  display: block;
  margin-bottom: 4px;
}
.coaching-default-hint {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 6px;
  padding: 6px 10px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--border2);
  line-height: 1.4;
}

/* Badge "Pris" sur calendrier chatteur */
.cal-badge-taken {
  background: rgba(248,113,113,.15);
  color: var(--red);
  border: 1px solid rgba(248,113,113,.3);
  font-size: 9px;
  font-weight: 600;
}

/* ============================================================
   SETTINGS — Branding / identité visuelle
   ============================================================ */
.branding-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.branding-preview {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px 24px;
  min-width: 160px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}
.branding-fields { flex: 1; min-width: 220px; }
.btn-upload {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}
.btn-upload:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ============================================================
   BADGES NOTIFICATIONS sur onglets
   ============================================================ */
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 10px;
  padding: 0 4px;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1;
}

/* ============================================================
   ACTION BAR — "À traiter maintenant"
   ============================================================ */
.acb-action-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  transition: opacity .15s;
}
.acb-action-item:hover { opacity: .85; }
.acb-all-good {
  font-size: 13px;
  color: var(--green);
  padding: 10px 0;
}

/* ============================================================
   PAGINATION historique
   ============================================================ */
.hist-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 0 4px;
}
.hist-pg-btn {
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text);
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  cursor: pointer;
  transition: all .15s;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.hist-pg-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.hist-pg-btn:disabled { opacity: .3; cursor: default; }
.hist-pg-info { font-size: 13px; color: var(--muted); min-width: 50px; text-align: center; }

/* ============================================================
   SEEN TAG — coaching vu/non vu
   ============================================================ */
.seen-tag {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
}
.seen-yes { background: rgba(74,222,128,.12); color: var(--green); border: 1px solid rgba(74,222,128,.25); }
.seen-no  { background: rgba(248,113,113,.1);  color: var(--red);   border: 1px solid rgba(248,113,113,.2); }