/* ── CRM CC Production — noir et or, mobile d'abord ── */
:root {
  --gold: #c9a227;
  --gold-light: #e8c766;
  --black: #111;
  --dark: #1b1b1b;
  --card: #222;
  --line: #333;
  --text: #f2f2f2;
  --muted: #aaa;
  --danger: #c0392b;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--black); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
button { cursor: pointer; font-size: 1rem; }
input, select, textarea {
  width: 100%; padding: .6rem; margin-top: .25rem;
  background: #2a2a2a; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; font-size: 1rem;
}
label { display: block; margin: .6rem 0; font-size: .95rem; }
a { color: var(--gold-light); }
h2 { margin: 1.2rem 0 .5rem; }
h3 { margin: 1.2rem 0 .4rem; }

/* ── Boutons ── */
.btn-gold {
  background: var(--gold); color: #111; border: none; font-weight: 700;
  padding: .7rem 1.1rem; border-radius: 8px;
}
.btn-gold:hover { background: var(--gold-light); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); padding: .5rem .8rem; border-radius: 8px; }
.btn-outline { background: transparent; color: var(--gold-light); border: 1px solid var(--gold); padding: .7rem 1rem; border-radius: 8px; }
.btn-danger { background: transparent; color: #e74c3c; border: 1px solid var(--danger); padding: .7rem 1rem; border-radius: 8px; }
.btn-small { padding: .3rem .6rem; font-size: .85rem; }

/* ── Bandeau démo ── */
.demo-banner {
  background: #7a5b00; color: #fff; text-align: center;
  padding: .6rem; font-weight: 600; font-size: .95rem;
}

/* ── Connexion ── */
.login-view { display: flex; justify-content: center; padding: 3rem 1rem; }

/* Correctif : un élément [hidden] doit rester masqué même si une règle
   display (ex. .login-view flex) le rendrait sinon visible après connexion. */
[hidden] { display: none !important; }
.login-card { width: 100%; max-width: 420px; background: var(--dark); border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; }
.logo { font-size: 2rem; font-weight: 900; letter-spacing: 1px; text-align: center; }
.logo span { color: var(--gold); }
.logo.small { font-size: 1.3rem; text-align: left; }
.logo-img { display: block; margin: 0 auto; max-width: 280px; width: 100%; height: auto; }
.logo-img.small { margin: 0; max-width: 150px; }
.login-tagline { text-align: center; color: var(--muted); margin: .3rem 0 1rem; }
.login-card .btn-gold { width: 100%; margin-top: .8rem; }
.error { color: #ff8a7a; }
.hint { color: var(--muted); font-size: .9rem; }
.login-demo { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .5rem; }

/* ── Barre supérieure + onglets ── */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.user-badge { color: var(--gold-light); font-weight: 600; margin-right: .5rem; }
.tabs { display: flex; gap: .3rem; overflow-x: auto; padding: .5rem 1rem; border-bottom: 1px solid var(--line); }
.tab { background: transparent; color: var(--muted); border: none; padding: .6rem .9rem; white-space: nowrap; border-bottom: 2px solid transparent; }
.tab.active { color: var(--gold-light); border-bottom-color: var(--gold); font-weight: 700; }
.pill { background: var(--gold); color: #111; border-radius: 999px; padding: 0 .5rem; font-size: .8rem; font-weight: 700; }

/* ── Filtres ── */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; padding: .8rem 1rem; align-items: end; }
.filters input[type="search"] { flex: 1 1 220px; }
.filters select { flex: 1 1 140px; }

/* ── Kanban ── */
.kanban { display: flex; gap: .8rem; overflow-x: auto; padding: 0 1rem 1rem; align-items: flex-start; }
.kanban-col { background: var(--dark); border: 1px solid var(--line); border-radius: 12px; min-width: 260px; flex: 1 1 260px; padding: .6rem; }
.kanban-col.drag-over { outline: 2px dashed var(--gold); }
.kanban-col h3 { margin: .2rem .3rem .6rem; font-size: 1rem; }
.kanban-col h3 span { color: var(--gold-light); }
.prospect-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem; margin-bottom: .5rem; cursor: grab;
}
.prospect-card:hover { border-color: var(--gold); }
.prospect-card strong { display: block; }
.prospect-card .meta { color: var(--muted); font-size: .85rem; margin-top: .25rem; }
.temp-chaud { color: #ff9d5c; }
.temp-froid { color: #7ec8ff; }

/* ── Listes / tableaux ── */
.tab-panel { padding: 0 1rem 2rem; }
.followup-list, .activity-list { list-style: none; padding: 0; }
.followup-list li, .activity-list li {
  background: var(--dark); border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem; margin-bottom: .5rem; display: flex; justify-content: space-between; gap: .5rem; align-items: center;
}
.followup-list .overdue { border-left: 4px solid var(--danger); }
.followup-list .today { border-left: 4px solid var(--gold); }
.data-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.data-table th, .data-table td { text-align: left; padding: .6rem .4rem; border-bottom: 1px solid var(--line); }
.data-table input { width: 90px; }
.commissions-summary { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin: 1rem 0; }
.stat { background: var(--dark); border: 1px solid var(--line); border-radius: 10px; padding: .7rem 1rem; }
.stat span { display: block; font-size: 1.4rem; font-weight: 800; color: var(--gold-light); }
.stat label { color: var(--muted); margin: 0; }

/* ── Modales ── */
dialog { background: var(--dark); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem; max-width: 560px; width: calc(100% - 2rem); }
dialog::backdrop { background: rgba(0, 0, 0, .7); }
.modal { position: relative; }
.modal-close { position: absolute; top: .4rem; right: .6rem; background: none; border: none; color: var(--muted); font-size: 1.2rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; }
.form-grid .full { grid-column: 1 / -1; }
.modal-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.activity-add { display: flex; gap: .5rem; }
.activity-add input { flex: 1; }
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .kanban-col { min-width: 82vw; }
}

/* ── Espace client (rôle 'client' seulement) ── */
.client-view { padding: 0 1rem 2rem; max-width: 720px; margin: 0 auto; }
.dossier-card { background: var(--dark); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; }
.dossier-grid { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1.2rem; margin: 0; }
.dossier-grid dt { color: var(--muted); }
.dossier-grid dd { margin: 0; font-weight: 600; }


/* ── V2 — automations (fusionné depuis fragments/automations.css) ── */
/* ── Automatisations V2 — classes NOUVELLES seulement ──────────
   Tout le reste du panneau réutilise styles.css (btn-gold,
   btn-ghost, btn-small, data-table, hint, stat, form-grid,
   modal-actions, commissions-summary). Ces trois classes n'ont
   pas d'équivalent dans styles.css, d'où ce fichier séparé. */
.auto-step-block {
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .8rem;
  margin-bottom: .6rem;
}
.auto-template {
  min-height: 5.5rem;
  resize: vertical;
}
.auto-badge-pending {
  display: inline-block;
  border: 1px solid var(--gold);
  color: var(--gold-light);
  border-radius: 999px;
  padding: .15rem .6rem;
  font-size: .85rem;
  white-space: nowrap;
}


/* ── V2 — booking (fusionné depuis fragments/booking.css) ── */
/* ── Bloc RDV : seules classes nouvelles indispensables ──
   Le reste réutilise styles.css (btn-gold, btn-ghost, data-table, hint).
   Palette reprise de styles.css : noir et or. */
.book-public-card { max-width: 640px; margin: 0 auto; padding: 0 1rem 2rem; }
.book-slots { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }
.book-slot {
  background: transparent; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: .5rem .9rem;
}
.book-slot:hover:not(:disabled) { border-color: var(--gold); }
.book-slot.is-selected { background: var(--gold); color: #111; font-weight: 700; border-color: var(--gold); }
.book-slot.is-taken { opacity: .35; text-decoration: line-through; cursor: not-allowed; }
.book-public-ok { color: var(--gold-light); }


/* ── V2 — campaigns (fusionné depuis fragments/campaigns.css) ── */
/* ─────────────────────────────────────────────────────────────
   Styles complémentaires — onglet « Campagnes » (V2)
   Réutilise les variables et classes existantes de styles.css
   (btn-gold, btn-ghost, data-table, hint, stat, form-grid…).
   Seules les classes nouvelles indispensables au bloc sont ici.
   ───────────────────────────────────────────────────────────── */

/* Avertissement prudence (perdus, migration manquante) */
.camp-warning {
  background: #3a2c00;
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: .6rem .8rem;
  color: var(--gold-light);
  font-size: .95rem;
}

/* Case à cocher de confirmation explicite (prospects « Perdu ») */
.camp-check {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin: .8rem 0;
}
.camp-check input {
  width: auto;
  margin-top: .2rem;
}

/* Bloc aperçu d'audience (chiffres avant lancement) */
.camp-preview {
  background: var(--dark);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .8rem 1rem;
  margin: 1rem 0;
}
.camp-preview-count {
  font-size: 1.05rem;
  margin: 0 0 .3rem;
}

/* Pastilles de statut d'envoi */
.camp-status {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--muted);
}
.camp-status-pending_provider {
  border-color: var(--gold);
  color: var(--gold-light);
}
.camp-status-sent {
  border-color: #2e7d32;
  color: #8bc48f;
}
.camp-status-failed {
  border-color: var(--danger);
  color: #e74c3c;
}
.camp-status-opened,
.camp-status-clicked {
  border-color: var(--gold-light);
  color: var(--gold-light);
}


/* ── V2 — dashboards (fusionné depuis fragments/dashboards.css) ── */
/* ── Tableaux de bord (bloc V2) — classes nouvelles indispensables ──
   Tout le reste réutilise les classes existantes de styles.css
   (btn-gold, btn-ghost, data-table, hint, stat). */
.dash-grid {
  display: flex; gap: 1rem; align-items: stretch; flex-wrap: wrap; margin: 1rem 0;
}
.dash-grid .stat { flex: 1 1 180px; }
.dash-period-row {
  display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; margin: 1rem 0 .2rem;
}
.dash-period-row label { flex: 1 1 220px; }
.dash-period-row select { width: 100%; }
th[data-dash-sort] { cursor: pointer; white-space: nowrap; }
th[data-dash-sort]:hover { color: var(--gold-light); }


/* ── V2 — meta (fusionné depuis fragments/meta.css) ── */
/* ── Bloc « Meta » — compléments indispensables seulement ─────
   Tout le reste réutilise les classes existantes de styles.css
   (btn-gold, data-table, hint, stat). Ces deux règles ne font
   que mettre en page le panneau Meta dans la charte noir et or. */
.meta-panel .meta-actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin: 1rem 0; }
.meta-panel .meta-stats-grid { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0; }
.meta-panel .meta-stats-grid .stat { flex: 1 1 140px; }
.meta-panel #meta-period { max-width: 260px; }


/* ── V2 — quickbooks (fusionné depuis fragments/quickbooks.css) ── */
/* ── Facturation QuickBooks — classes nouvelles indispensables ──
   Le reste du panneau réutilise les classes existantes de styles.css
   (btn-gold, btn-ghost, data-table, hint, stat, followup-list, meta).
   Palette reprise de styles.css : or --gold / --gold-light, fond noir,
   danger --danger. À charger après styles.css (coordinateur). */

/* Badges de statut de facture */
.qb-badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  white-space: nowrap;
}
.qb-badge-sent {
  background: transparent;
  color: var(--gold-light);
  border: 1px solid var(--gold);
}
.qb-badge-paid {
  background: #1e4634;
  color: #7fd6a4;
  border: 1px solid #2e7d52;
}
.qb-badge-overdue {
  background: transparent;
  color: #e74c3c;
  border: 1px solid var(--danger);
}

/* Ligne de facture en retard : rappel visuel, sans masquer le contenu */
.qb-row-overdue td {
  border-bottom: 1px solid var(--danger);
}

/* Barre d'actions et filtres du panneau Facturation */
.qb-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 1rem 0;
}
.qb-filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}
.qb-filters label {
  flex: 1 1 220px;
}


/* ── V2 — webleads (fusionné depuis fragments/webleads.css) ── */
/* Bloc 7 — Leads Web & Google Ads : une seule classe nouvelle.
   Tout le reste réutilise styles.css (btn-gold, btn-ghost,
   data-table, hint, stat, form-grid, modal-actions). */
.web-banner-pending {
  background: #2a2a2a;
  border: 1px solid var(--gold, #c9a227);
  border-left: 4px solid var(--gold, #c9a227);
  border-radius: 10px;
  padding: .7rem 1rem;
  color: var(--text, #f2f2f2);
}
.web-capture-form {
  max-width: 560px;
}
