/*
 * Feuille de style partagée de l'app ProxyTags — identité visuelle
 * "Chaleur" (voir CLAUDE-site.md à la racine du dépôt, section "Visuel et
 * charte" : c'est la même charte que le site promotionnel, appliquée ici
 * à l'admin marchand et aux pages client). Chargée sur les 14 templates
 * via Brand::styleTag(). Contient tout ce qui est commun entre pages
 * (nav, tableaux, badges, boutons, formulaires, chrome de marque,
 * sélecteur de langue) ; chaque template garde un petit bloc <style>
 * résiduel pour ses classes propres (voir chaque fichier).
 *
 * Densité : les gabarits admin sont des écrans d'information denses (pas
 * des pages marketing) — mêmes couleurs/typo/rayons que le site, mais
 * boutons et champs légèrement plus compacts que les tailles "CTA mobile"
 * du site (56px). Palette et rôles des couleurs inchangés.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@700;800&display=swap');

:root {
  --indigo: #2A2356;
  --orange: #E8703D;
  --orange-press: #D6602F;
  --cream: #FAF7F2;
  --white: #FFFFFF;
  --body: #55506B;
  --muted: #9A94A8;
  --line: #E7E1D6;
  --error: #C8442B;
  --error-bg: #FFF6F2;

  --shadow-card: 0 6px 16px rgba(42, 35, 86, 0.05);
  --shadow-btn: 0 8px 18px rgba(232, 112, 61, 0.28);

  /* Pas de vert défini dans la charte — un état "positif/actif" se rend
     en indigo teinté plutôt qu'une couleur ad hoc hors palette. */
  --positive-bg: rgba(42, 35, 86, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
  background: var(--cream);
  color: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  color: var(--indigo);
  margin: 0;
}

h1 { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
h2 { font-size: 1.05rem; font-weight: 700; margin-top: 32px; margin-bottom: 12px; }

a { color: var(--orange); }

/* ---------- Bannière de témoins (Brand::cookieNotice()) ---------- */

.cookie-notice {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--white);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 16px rgba(42, 35, 86, 0.08);
  padding: 14px 16px;
}

.cookie-notice-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cookie-notice p {
  flex: 1;
  min-width: 200px;
  margin: 0;
  font-size: 0.8rem;
  color: var(--body);
}

.cookie-notice a { text-decoration: underline; }

.cookie-notice button {
  flex-shrink: 0;
  padding: 8px 20px;
}

/* ---------- Chrome de marque (Brand::topBar()/footerBar()) ---------- */

.brand-topbar { margin-bottom: 16px; }

.brand-footerbar {
  text-align: center;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ---------- Sélecteur de langue (I18n::switcherHtml()) ---------- */

.lang-switch {
  display: inline-flex;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px;
  margin-bottom: 16px;
}

.lang-switch a {
  min-width: 56px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--indigo);
  text-decoration: none;
}

.lang-switch a.active {
  background: var(--indigo);
  color: var(--white);
  font-weight: 700;
}

/* ---------- Rangée supérieure : logo ProxyTags à gauche, bouton Profil à
   droite (Sprint 11bis — voir templates/_admin_nav.php et dashboard.php).
   Partagée entre les pages admin marchand ET le dashboard client — langue
   et déconnexion ne vivent plus ici, elles ont déménagé dans la page
   Profil elle-même (admin_profile.php / customer_profile.php). ---------- */

.page-topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.page-topbar .brand-topbar { margin-bottom: 0; }

.page-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.btn-profile {
  display: inline-flex;
  align-items: center;
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--indigo);
  background: var(--white);
  color: var(--indigo);
  text-decoration: none;
  white-space: nowrap;
}

.btn-profile:hover { background: var(--cream); }

.btn-profile.active { background: var(--indigo); color: var(--white); }

/* ---------- Nav admin (commun à toutes les pages /admin/*) ---------- */

nav {
  margin: 16px 0 24px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

nav a, nav button {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--indigo);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

nav a.active {
  font-weight: 700;
  border-bottom-color: var(--orange);
}

nav button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--error);
  cursor: pointer;
  padding-left: 0;
  padding-right: 0;
}

/* ---------- Tableaux (activité, membres, staff) ---------- */

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

th, td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }

th {
  color: var(--muted);
  font-size: 0.72rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }

/* ---------- Badges ---------- */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  background: var(--line);
  color: var(--body);
}

.badge.active, .badge.on, .badge.converted {
  background: var(--positive-bg);
  color: var(--indigo);
}

.badge.suspended, .badge.new {
  background: var(--error-bg);
  color: var(--error);
}

.badge.contacted {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--indigo);
}

/* ---------- Boutons ----------
   L'orange reste la couleur d'action (voir CLAUDE-site.md) : actions
   positives/principales en plein orange, actions neutres en contour
   indigo, actions destructives en contour --error. Noms de classe
   existants conservés tels quels (submit/activate/confirm/archive/
   suspend/danger/cancel) — seule la couleur change. */

button {
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--indigo);
  background: var(--white);
  color: var(--indigo);
  cursor: pointer;
}

button:hover { background: var(--cream); }

.submit, .activate, .confirm {
  background: var(--orange);
  color: var(--white);
  border: none;
  box-shadow: var(--shadow-btn);
}

.submit:hover, .activate:hover, .confirm:hover { background: var(--orange-press); }

.archive {
  background: var(--white);
  color: var(--indigo);
  border: 1.5px solid var(--indigo);
}

.suspend, .danger, .cancel {
  background: var(--white);
  color: var(--error);
  border: 1.5px solid var(--error);
}

.suspend:hover, .danger:hover, .cancel:hover { background: var(--error-bg); }

/* ---------- Formulaires ---------- */

input, select, textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0 16px;
  height: 48px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--indigo);
  margin-bottom: 12px;
}

textarea { height: auto; padding: 12px 16px; min-height: 90px; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 4px rgba(42, 35, 86, 0.12);
}

label.field {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--indigo);
  margin-bottom: 6px;
  margin-top: 14px;
}

/* ---------- Messages d'état ---------- */

.hint { color: var(--muted); font-size: 0.85rem; margin-bottom: 12px; }

.error { color: var(--error); font-size: 0.85rem; margin-top: 8px; }

/* Pas de vert dans la charte : une confirmation se rend en indigo, pas
   une couleur ad hoc hors palette. */
.success { color: var(--indigo); font-weight: 600; font-size: 0.85rem; margin-top: 8px; }

/* ---------- Cartes / lignes (base commune, voir résiduel par page) ---------- */

.row {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 10px;
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.row-flex {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.row .meta { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }

/* ---------- Résumé de programme (admin_dashboard.php + admin_reward.php) ---------- */

.program-summary {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  margin-top: 10px;
  background: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.program-summary p { margin: 0; font-size: 0.9rem; color: var(--body); }
.program-summary .none { color: var(--muted); font-style: italic; }
.program-summary a { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }

/* ---------- Accordéon (admin_activity.php, Sprint 11 — même composant que
   .faq-item du site promotionnel, voir assets/css/style.css) ---------- */

.accordion-list { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 32px; }

.accordion-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 22px;
  box-shadow: var(--shadow-card);
}

.accordion-item summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--indigo);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.accordion-item summary::-webkit-details-marker { display: none; }

.accordion-item summary .chevron { transition: transform 0.15s ease; transform: rotate(90deg); flex-shrink: 0; }

.accordion-item[open] summary .chevron { transform: rotate(-90deg); }

.accordion-item .accordion-body { padding-bottom: 20px; }

/* ---------- KPI / interface super admin (Sprint 15, templates/super_admin_*.php) ---------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 16px 0 28px;
}

.kpi-tile {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.kpi-tile .kpi-value {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--indigo);
  line-height: 1.1;
}

.kpi-tile .kpi-label { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 14px; }
.toolbar form { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar input, .toolbar select { width: auto; }
