:root{
  --rcv-bg: #0b0d12;
  --rcv-surface: #111622;
  --rcv-surface-2: #161d2b;
  --rcv-border: #222a3a;
  --rcv-text: #e8ebf2;
  --rcv-muted: #9aa3b2;
  --rcv-accent: #e01e37;   /* RCV red */
  --rcv-accent-2: #ff4d6d; /* lighter red */
  --rcv-ok: #2ecc71;
  --rcv-warn: #f1c40f;
  --rcv-bad: #ff4d6d;
  --rcv-focus: #6ea8fe;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);

  --nav-bg: rgba(12, 14, 20, 0.80);
  --nav-border: #1f2532;
  --nav-hover: #1a2130;
  --nav-active-bg: rgba(80, 130, 255, 0.14);
  --nav-active-ring: rgba(80, 130, 255, 0.35);
  --nav-height: 56px;
  --nav-icon-size: 26px;

  --hdr-bg: rgba(12,14,20,0.85);
  --hdr-border: #1f2532;
  --hdr-maxw: 1280px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin:0;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(224,30,55,.12), transparent 60%),
              radial-gradient(1000px 500px at -10% 0%, rgba(255,77,109,.08), transparent 55%),
              var(--rcv-bg);
  color: var(--rcv-text);
  font: 14px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* Header */
.rcv-header{
  position: sticky;
  top: 0;
  z-index: 50;
  display:flex; align-items:center; gap:16px;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,.1));
  border-bottom: 1px solid var(--rcv-border);
  backdrop-filter: blur(8px);
}
.brand{
  display:flex; align-items:center; gap:10px; font-weight:700; letter-spacing:.5px;
}
.brand__logo{
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: url("rcv-logo.png") center/contain no-repeat;
  box-shadow: none;
}
.brand__name{ font-size: 16px; }
.rcv-nav{ margin-left:auto; display:flex; gap:14px; }

/* NEW: nav buttons look */
.rcv-nav .btn{
  padding: 8px 12px;              /* un peu plus compact */
  border-radius: 999px;           /* pastille */
  border-color: var(--rcv-border);
  background: transparent;
}
.rcv-nav .btn:hover{
  background: rgba(255,255,255,.06);
}

/* liens génériques */
a{ color: var(--rcv-text); text-decoration: none; }
a:hover{ color: #fff; text-shadow: 0 0 10px rgba(255,255,255,.15); }

/* Layout */
.container{ max-width: 1200px; margin: 24px auto; padding: 0 18px; }
h1{ font-size: 22px; margin: 8px 0 18px; }
h2{ font-size: 16px; margin: 0 0 12px; color: #fff; }

/* Cards */
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
  border: 1px solid var(--rcv-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card + .card{ margin-top: 18px; }
.card--accent{
  border-color: rgba(224,30,55,.5);
  box-shadow: 0 10px 30px rgba(224,30,55,.08);
}

/* Form */
form .grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
}
label{ display:flex; flex-direction:column; gap:6px; color: var(--rcv-muted); }
input[type="text"], input[type="search"], input[type="email"], input[type="number"], input[type="date"], input[type="password"], input:not([type]), select{
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--rcv-border);
  background: var(--rcv-surface-2);
  color: var(--rcv-text);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
input::placeholder{ color: var(--rcv-muted); }
input:focus, select:focus{
  border-color: var(--rcv-focus);
  box-shadow: 0 0 0 3px rgba(110,168,254,.15);
}

/* Harmoniser l'autofill (Chrome/Edge) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus{
  -webkit-text-fill-color: var(--rcv-text);
  box-shadow: 0 0 0px 1000px var(--rcv-surface-2) inset;
  border: 1px solid var(--rcv-border);
}

/* Laisser de la place à l’icône “afficher le mot de passe” */
input[type="password"]{ padding-right: 36px; }
.form-actions{ display:flex; gap:10px; align-items:center; margin-top: 10px; }

/* Buttons */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--rcv-surface-2);
  color: var(--rcv-text);
  cursor: pointer;
  transition: transform .05s ease, filter .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{ filter: brightness(1.1); }
.btn:active{ transform: translateY(1px); }
.btn-primary{
  background: linear-gradient(135deg, var(--rcv-accent), var(--rcv-accent-2));
  border-color: rgba(224,30,55,.6);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.btn-danger{
  background: linear-gradient(135deg, #b3122b, #8a0f22);
  border-color: rgba(255,77,109,.5);
  color: #fff;
}
.btn-ghost{
  background: transparent;
  border-color: var(--rcv-border);
}

/* Table */
#subs-table{
  table-layout: fixed;   /* largeur des colonnes basée sur le CSS, pas sur le contenu */
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--rcv-border);
  border-radius: var(--radius);
  background: var(--rcv-surface);
}
#subs-table thead th{
  position: sticky; top: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  color: var(--rcv-muted);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rcv-border);
  user-select: none;
  white-space: nowrap;    /* évite un retour à la ligne qui ferait grossir la ligne */
  line-height: 1.2;       /* ligne stable */
  height: 42px;           /* hauteur fixe pour éviter les variations quand l’icône change */
}
#subs-table tbody td{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#subs-table tbody tr:hover{
  background: rgba(255,255,255,.02);
}

/* Largeurs fixes par colonne (10 colonnes) — somme ≈ 100% */
#subs-table thead th:nth-child(1),  #subs-table tbody td:nth-child(1)  { width: 15%; } /* Discord */
#subs-table thead th:nth-child(2),  #subs-table tbody td:nth-child(2)  { width: 11%; } /* Discord ID */
#subs-table thead th:nth-child(3),  #subs-table tbody td:nth-child(3)  { width: 23%; } /* Email */
#subs-table thead th:nth-child(4),  #subs-table tbody td:nth-child(4)  { width: 9%;  } /* Montant donné */
#subs-table thead th:nth-child(5),  #subs-table tbody td:nth-child(5)  { width: 8%;  } /* Grade */
#subs-table thead th:nth-child(6),  #subs-table tbody td:nth-child(6)  { width: 8%;  } /* Date de début */
#subs-table thead th:nth-child(7),  #subs-table tbody td:nth-child(7)  { width: 8%;  } /* Date de fin */
#subs-table thead th:nth-child(8),  #subs-table tbody td:nth-child(8)  { width: 7%;  } /* Statut */
#subs-table thead th:nth-child(9),  #subs-table tbody td:nth-child(9)  { width: 5%;  } /* Accès */
#subs-table thead th:nth-child(10), #subs-table tbody td:nth-child(10) { width: 6%;  } /* Actions */

/* Option: garantir un minimum pour le bouton “Modifier” si la fenêtre est étroite */
#subs-table thead th:nth-child(10),
#subs-table tbody td:nth-child(10){
  min-width: 110px;  /* ajuste si besoin */
}

/* Appliquer le même style aux tableaux secondaires */
#subs-table, #users-table, #logs-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--rcv-border);
  border-radius: var(--radius);
  background: var(--rcv-surface);
}
#subs-table thead th, #users-table thead th, #logs-table thead th{
  position: sticky; top: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  color: var(--rcv-muted);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rcv-border);
  user-select: none;
  white-space: nowrap;    /* évite un retour à la ligne qui ferait grossir la ligne */
  line-height: 1.2;       /* ligne stable */
  height: 42px;           /* hauteur fixe pour éviter les variations quand l’icône change */
}
#subs-table tbody td, #users-table tbody td, #logs-table tbody td{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
#subs-table tbody tr:hover, #users-table tbody tr:hover, #logs-table tbody tr:hover{
  background: rgba(255,255,255,.02);
}

/* Sort indicators */
th.sortable{ cursor: pointer; }
th .sort-indicator{
  display: none !important;   /* plus d’impact du texte ↕/▲/▼ sur la hauteur */
}
th.sortable{
  position: relative;
  padding-right: 22px;        /* laisse de la place à l'icône */
}
th.sortable::after{
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  opacity: .7;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
  /* double flèche neutre (↕) — TOUT sur une seule ligne */
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="%23AAB2C3" d="M8 2l3 3H9v6H7V5H5l3-3zM8 14l-3-3h2V5h2v6h2l-3 3z"/></svg>');
}
th[aria-sort="asc"]::after{
  opacity: 1;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="%23E8EBF2" d="M8 3l3.5 3.5H9v6H7v-6H4.5L8 3z"/></svg>');
}
th[aria-sort="desc"]::after{
  opacity: 1;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="%23E8EBF2" d="M8 13l-3.5-3.5H7v-6h2v6h2.5L8 13z"/></svg>');
}

/* Status badges */
.status{
  display: inline-flex;             /* centrage plus fiable */
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  white-space: nowrap;              /* évite de casser sur 2 lignes */
  text-align: center;
}

.status-ok{
  background: rgba(46,204,113,.12);
  color: #8ef0b3;
  border-color: rgba(46,204,113,.35);
}
.status-warning{
  background: rgba(241,196,15,.12);
  color: #ffe28a;
  border-color: rgba(241,196,15,.35);
}
.status-expired{
  background: rgba(255,77,109,.12);
  color: #ff9fb0;
  border-color: rgba(255,77,109,.35);
}

/* Renforce légèrement la spécificité */
.status.status-ok{
  background: rgba(46,204,113,.12);
  color: #8ef0b3;
  border-color: rgba(46,204,113,.35);
}
.status.status-warning{
  background: rgba(241,196,15,.12);
  color: #ffe28a;
  border-color: rgba(241,196,15,.35);
}
.status.status-expired{
  background: rgba(255,77,109,.12);
  color: #ff9fb0;
  border-color: rgba(255,77,109,.35);
}

/* Utility */
.muted{ color: var(--rcv-muted); }

/* Login */
.login-wrapper{
  min-height: calc(100vh - 60px);
  display:grid; place-items:center;
}
.login-card{
  width: 100%; max-width: 420px;
  padding: 18px;
  border: 1px solid var(--rcv-border);
  border-radius: var(--radius);
  background: var(--rcv-surface);
  box-shadow: var(--shadow);
}

/* Tools page sections */
.tools-grid{
  display:grid; gap: 16px;
  grid-template-columns: repeat(2, minmax(0,1fr));
}
@media (max-width: 900px){
  form .grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tools-grid{ grid-template-columns: 1fr; }
}

/* Modal */
.modal{ position: fixed; inset: 0; display: none; place-items: center; z-index: 100; }
.modal.open{ display: grid; }
.modal__backdrop{ position:absolute; inset:0; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); }
.modal__dialog{
  position: relative;
  width: min(920px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: var(--rcv-surface);
  border: 1px solid var(--rcv-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0;
}
.modal__header{
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--rcv-border);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
}
.modal__body{ padding: 14px; }
.modal__close{ line-height: 1; }
.filters{
  display:grid;
  grid-template-columns: repeat(8, minmax(0,1fr));
  gap:10px;
  margin: 10px 0 14px;
}
@media (max-width: 1100px){ .filters{ grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 700px){ .filters{ grid-template-columns: repeat(2, minmax(0,1fr)); }}

/* Légende des filtres (au-dessus du tableau) */
.filters-legend{
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 6px 0 10px;
  color: var(--rcv-muted);
  font-size: 12px;
}
.filters-legend .legend-item{
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
}
.filters-legend .legend-item strong{
  color:#fff;
  font-weight:600;
}

/* Grille des filtres */
.filters{
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1.2fr 1.2fr auto; /* texte plus large, bouton à la fin */
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
@media (max-width: 1100px){
  .filters-legend{ grid-template-columns: 1fr; }
  .filters{ grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (max-width: 700px){
  .filters{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* En-têtes stables (une seule ligne, pas d’effet de métrique au tri) */
#subs-table thead th,
#users-table thead th,
#logs-table thead th{
  white-space: nowrap;
  padding: 0 12px !important;     /* padding vertical nul pour ne pas influencer la hauteur */
  line-height: 44px !important;   /* texte centré verticalement et métrique stable */
  vertical-align: middle;
  position: relative;             /* requis pour le pseudo-élément d’icône */
}

/* 2) On retire l’ancien span du flux pour qu’il n’influence JAMAIS la hauteur */
th .sort-indicator{
  display: none !important;
}

/* 3) Icône de tri hors flux, à droite, taille fixe */
th.sortable{
  padding-right: 22px; /* laisse de la place à l'icône */
  position: relative;
}
th.sortable::after{
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  opacity: .7;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
  /* double flèche neutre (↕) — TOUT sur une seule ligne */
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="%23AAB2C3" d="M8 2l3 3H9v6H7V5H5l3-3zM8 14l-3-3h2V5h2v6h2l-3 3z"/></svg>');
}
th[aria-sort="asc"]::after{
  opacity: 1;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="%23E8EBF2" d="M8 3l3.5 3.5H9v6H7v-6H4.5L8 3z"/></svg>');
}
th[aria-sort="desc"]::after{
  opacity: 1;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="%23E8EBF2" d="M8 13l-3.5-3.5H7v-6h2v6h2.5L8 13z"/></svg>');
}

/* Status badges */
.status{
  display: inline-flex;             /* centrage plus fiable */
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  white-space: nowrap;              /* évite de casser sur 2 lignes */
  text-align: center;
}

.status-ok{
  background: rgba(46,204,113,.12);
  color: #8ef0b3;
  border-color: rgba(46,204,113,.35);
}
.status-warning{
  background: rgba(241,196,15,.12);
  color: #ffe28a;
  border-color: rgba(241,196,15,.35);
}
.status-expired{
  background: rgba(255,77,109,.12);
  color: #ff9fb0;
  border-color: rgba(255,77,109,.35);
}

/* Renforce légèrement la spécificité */
.status.status-ok{
  background: rgba(46,204,113,.12);
  color: #8ef0b3;
  border-color: rgba(46,204,113,.35);
}
.status.status-warning{
  background: rgba(241,196,15,.12);
  color: #ffe28a;
  border-color: rgba(241,196,15,.35);
}
.status.status-expired{
  background: rgba(255,77,109,.12);
  color: #ff9fb0;
  border-color: rgba(255,77,109,.35);
}

/* Utility */
.muted{ color: var(--rcv-muted); }

/* Login */
.login-wrapper{
  min-height: calc(100vh - 60px);
  display:grid; place-items:center;
}
.login-card{
  width: 100%; max-width: 420px;
  padding: 18px;
  border: 1px solid var(--rcv-border);
  border-radius: var(--radius);
  background: var(--rcv-surface);
  box-shadow: var(--shadow);
}

/* Tools page sections */
.tools-grid{
  display:grid; gap: 16px;
  grid-template-columns: repeat(2, minmax(0,1fr));
}
@media (max-width: 900px){
  form .grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tools-grid{ grid-template-columns: 1fr; }
}

/* Modal */
.modal{ position: fixed; inset: 0; display: none; place-items: center; z-index: 100; }
.modal.open{ display: grid; }
.modal__backdrop{ position:absolute; inset:0; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); }
.modal__dialog{
  position: relative;
  width: min(920px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: var(--rcv-surface);
  border: 1px solid var(--rcv-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0;
}
.modal__header{
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--rcv-border);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
}
.modal__body{ padding: 14px; }
.modal__close{ line-height: 1; }
.filters{
  display:grid;
  grid-template-columns: repeat(8, minmax(0,1fr));
  gap:10px;
  margin: 10px 0 14px;
}
@media (max-width: 1100px){ .filters{ grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 700px){ .filters{ grid-template-columns: repeat(2, minmax(0,1fr)); }}

/* Légende des filtres (au-dessus du tableau) */
.filters-legend{
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 6px 0 10px;
  color: var(--rcv-muted);
  font-size: 12px;
}
.filters-legend .legend-item{
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
}
.filters-legend .legend-item strong{
  color:#fff;
  font-weight:600;
}

/* Grille des filtres */
.filters{
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1.2fr 1.2fr auto; /* texte plus large, bouton à la fin */
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
@media (max-width: 1100px){
  .filters-legend{ grid-template-columns: 1fr; }
  .filters{ grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (max-width: 700px){
  .filters{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* En-têtes stables (une seule ligne, pas d’effet de métrique au tri) */
#subs-table thead th,
#users-table thead th,
#logs-table thead th{
  white-space: nowrap;
  padding: 0 12px !important;     /* padding vertical nul pour ne pas influencer la hauteur */
  line-height: 44px !important;   /* texte centré verticalement et métrique stable */
  vertical-align: middle;
  position: relative;             /* requis pour le pseudo-élément d’icône */
}

/* 2) On retire l’ancien span du flux pour qu’il n’influence JAMAIS la hauteur */
th .sort-indicator{
  display: none !important;
}

/* 3) Icône de tri hors flux, à droite, taille fixe */
th.sortable{
  padding-right: 22px; /* laisse de la place à l'icône */
  position: relative;
}
th.sortable::after{
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  opacity: .7;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
  /* double flèche neutre (↕) — TOUT sur une seule ligne */
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="%23AAB2C3" d="M8 2l3 3H9v6H7V5H5l3-3zM8 14l-3-3h2V5h2v6h2l-3 3z"/></svg>');
}
th[aria-sort="asc"]::after{
  opacity: 1;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="%23E8EBF2" d="M8 3l3.5 3.5H9v6H7v-6H4.5L8 3z"/></svg>');
}
th[aria-sort="desc"]::after{
  opacity: 1;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="%23E8EBF2" d="M8 13l-3.5-3.5H7v-6h2v6h2.5L8 13z"/></svg>');
}

/* Status badges */
.status{
  display: inline-flex;             /* centrage plus fiable */
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  white-space: nowrap;              /* évite de casser sur 2 lignes */
  text-align: center;
}

.status-ok{
  background: rgba(46,204,113,.12);
  color: #8ef0b3;
  border-color: rgba(46,204,113,.35);
}
.status-warning{
  background: rgba(241,196,15,.12);
  color: #ffe28a;
  border-color: rgba(241,196,15,.35);
}
.status-expired{
  background: rgba(255,77,109,.12);
  color: #ff9fb0;
  border-color: rgba(255,77,109,.35);
}

/* Renforce légèrement la spécificité */
.status.status-ok{
  background: rgba(46,204,113,.12);
  color: #8ef0b3;
  border-color: rgba(46,204,113,.35);
}
.status.status-warning{
  background: rgba(241,196,15,.12);
  color: #ffe28a;
  border-color: rgba(241,196,15,.35);
}
.status.status-expired{
  background: rgba(255,77,109,.12);
  color: #ff9fb0;
  border-color: rgba(255,77,109,.35);
}

/* Utility */
.muted{ color: var(--rcv-muted); }

/* Login */
.login-wrapper{
  min-height: calc(100vh - 60px);
  display:grid; place-items:center;
}
.login-card{
  width: 100%; max-width: 420px;
  padding: 18px;
  border: 1px solid var(--rcv-border);
  border-radius: var(--radius);
  background: var(--rcv-surface);
  box-shadow: var(--shadow);
}

/* Tools page sections */
.tools-grid{
  display:grid; gap: 16px;
  grid-template-columns: repeat(2, minmax(0,1fr));
}
@media (max-width: 900px){
  form .grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tools-grid{ grid-template-columns: 1fr; }
}

/* Modal */
.modal{ position: fixed; inset: 0; display: none; place-items: center; z-index: 100; }
.modal.open{ display: grid; }
.modal__backdrop{ position:absolute; inset:0; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); }
.modal__dialog{
  position: relative;
  width: min(920px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: var(--rcv-surface);
  border: 1px solid var(--rcv-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0;
}
.modal__header{
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--rcv-border);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
}
.modal__body{ padding: 14px; }
.modal__close{ line-height: 1; }
.filters{
  display:grid;
  grid-template-columns: repeat(8, minmax(0,1fr));
  gap:10px;
  margin: 10px 0 14px;
}
@media (max-width: 1100px){ .filters{ grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 700px){ .filters{ grid-template-columns: repeat(2, minmax(0,1fr)); }}

/* Légende des filtres (au-dessus du tableau) */
.filters-legend{
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 6px 0 10px;
  color: var(--rcv-muted);
  font-size: 12px;
}
.filters-legend .legend-item{
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
}
.filters-legend .legend-item strong{
  color:#fff;
  font-weight:600;
}

/* Grille des filtres */
.filters{
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1.2fr 1.2fr auto; /* texte plus large, bouton à la fin */
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
@media (max-width: 1100px){
  .filters-legend{ grid-template-columns: 1fr; }
  .filters{ grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (max-width: 700px){
  .filters{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* En-têtes stables (une seule ligne, pas d’effet de métrique au tri) */
#subs-table thead th,
#users-table thead th,
#logs-table thead th{
  white-space: nowrap;
  padding: 0 12px !important;     /* padding vertical nul pour ne pas influencer la hauteur */
  line-height: 44px !important;   /* texte centré verticalement et métrique stable */
  vertical-align: middle;
  position: relative;             /* requis pour le pseudo-élément d’icône */
}

/* 2) On retire l’ancien span du flux pour qu’il n’influence JAMAIS la hauteur */
th .sort-indicator{
  display: none !important;
}

/* 3) Icône de tri hors flux, à droite, taille fixe */
th.sortable{
  padding-right: 22px; /* laisse de la place à l'icône */
  position: relative;
}
th.sortable::after{
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  opacity: .7;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
  /* double flèche neutre (↕) — TOUT sur une seule ligne */
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="%23AAB2C3" d="M8 2l3 3H9v6H7V5H5l3-3zM8 14l-3-3h2V5h2v6h2l-3 3z"/></svg>');
}
th[aria-sort="asc"]::after{
  opacity: 1;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="%23E8EBF2" d="M8 3l3.5 3.5H9v6H7v-6H4.5L8 3z"/></svg>');
}
th[aria-sort="desc"]::after{
  opacity: 1;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="%23E8EBF2" d="M8 13l-3.5-3.5H7v-6h2v6h2.5L8 13z"/></svg>');
}

/* Status badges */
.status{
  display: inline-flex;             /* centrage plus fiable */
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  white-space: nowrap;              /* évite de casser sur 2 lignes */
  text-align: center;
}

.status-ok{
  background: rgba(46,204,113,.12);
  color: #8ef0b3;
  border-color: rgba(46,204,113,.35);
}
.status-warning{
  background: rgba(241,196,15,.12);
  color: #ffe28a;
  border-color: rgba(241,196,15,.35);
}
.status-expired{
  background: rgba(255,77,109,.12);
  color: #ff9fb0;
  border-color: rgba(255,77,109,.35);
}

/* Renforce légèrement la spécificité */
.status.status-ok{
  background: rgba(46,204,113,.12);
  color: #8ef0b3;
  border-color: rgba(46,204,113,.35);
}
.status.status-warning{
  background: rgba(241,196,15,.12);
  color: #ffe28a;
  border-color: rgba(241,196,15,.35);
}
.status.status-expired{
  background: rgba(255,77,109,.12);
  color: #ff9fb0;
  border-color: rgba(255,77,109,.35);
}

/* Utility */
.muted{ color: var(--rcv-muted); }

/* Login */
.login-wrapper{
  min-height: calc(100vh - 60px);
  display:grid; place-items:center;
}
.login-card{
  width: 100%; max-width: 420px;
  padding: 18px;
  border: 1px solid var(--rcv-border);
  border-radius: var(--radius);
  background: var(--rcv-surface);
  box-shadow: var(--shadow);
}

/* Tools page sections */
.tools-grid{
  display:grid; gap: 16px;
  grid-template-columns: repeat(2, minmax(0,1fr));
}
@media (max-width: 900px){
  form .grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tools-grid{ grid-template-columns: 1fr; }
}

/* Modal */
.modal{ position: fixed; inset: 0; display: none; place-items: center; z-index: 100; }
.modal.open{ display: grid; }
.modal__backdrop{ position:absolute; inset:0; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); }
.modal__dialog{
  position: relative;
  width: min(920px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: var(--rcv-surface);
  border: 1px solid var(--rcv-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0;
}
.modal__header{
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--rcv-border);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
}
.modal__body{ padding: 14px; }
.modal__close{ line-height: 1; }
.filters{
  display:grid;
  grid-template-columns: repeat(8, minmax(0,1fr));
  gap:10px;
  margin: 10px 0 14px;
}
@media (max-width: 1100px){ .filters{ grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 700px){ .filters{ grid-template-columns: repeat(2, minmax(0,1fr)); }}

/* Légende des filtres (au-dessus du tableau) */
.filters-legend{
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 6px 0 10px;
  color: var(--rcv-muted);
  font-size: 12px;
}
.filters-legend .legend-item{
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
}
.filters-legend .legend-item strong{
  color:#fff;
  font-weight:600;
}

/* Grille des filtres */
.filters{
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1.2fr 1.2fr auto; /* texte plus large, bouton à la fin */
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
@media (max-width: 1100px){
  .filters-legend{ grid-template-columns: 1fr; }
  .filters{ grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (max-width: 700px){
  .filters{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* En-têtes stables (une seule ligne, pas d’effet de métrique au tri) */
#subs-table thead th,
#users-table thead th,
#logs-table thead th{
  white-space: nowrap;
  padding: 0 12px !important;     /* padding vertical nul pour ne pas influencer la hauteur */
  line-height: 44px !important;   /* texte centré verticalement et métrique stable */
  vertical-align: middle;
  position: relative;             /* requis pour le pseudo-élément d’icône */
}

/* 2) On retire l’ancien span du flux pour qu’il n’influence JAMAIS la hauteur */
th .sort-indicator{
  display: none !important;
}

/* 3) Icône de tri hors flux, à droite, taille fixe */
th.sortable{
  padding-right: 22px; /* laisse de la place à l'icône */
  position: relative;
}
th.sortable::after{
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  opacity: .7;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
  /* double flèche neutre (↕) — TOUT sur une seule ligne */
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="%23AAB2C3" d="M8 2l3 3H9v6H7V5H5l3-3zM8 14l-3-3h2V5h2v6h2l-3 3z"/></svg>');
}
th[aria-sort="asc"]::after{
  opacity: 1;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="%23E8EBF2" d="M8 3l3.5 3.5H9v6H7v-6H4.5L8 3z"/></svg>');
}
th[aria-sort="desc"]::after{
  opacity: 1;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="%23E8EBF2" d="M8 13l-3.5-3.5H7v-6h2v6h2.5L8 13z"/></svg>');
}

/* Panneau de colonnes — version améliorée */
.cols-panel{
  position: relative;
  margin: 8px 0 0;
  z-index: 15;
}
.cols-panel[hidden]{ display: none; }
.cols-panel .cols-panel__inner{
  position: absolute;
  right: 0;
  min-width: 260px;
  max-width: 320px;
  padding: 10px;
  border: 1px solid var(--rcv-border);
  border-radius: var(--radius);
  background: var(--rcv-surface);
  box-shadow: var(--shadow);
  transform: translateY(6px) scale(.98);
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
}
.cols-panel.open .cols-panel__inner{
  transform: translateY(10px) scale(1);
  opacity: 1;
}

/* Petite flèche vers le bouton */
.cols-panel .cols-panel__inner::before{
  content: '';
  position: absolute;
  top: -8px;
  right: 18px;
  border: 8px solid transparent;
  border-bottom-color: var(--rcv-surface);
  filter: drop-shadow(0 -1px 0 var(--rcv-border));
}

/* En-tête/Corps/Pied */
.cols-panel__header{
  display:flex; align-items:center; justify-content:space-between; margin-bottom:8px;
}
.cols-panel__header strong{ color:#fff; }
.cols-close{
  width: 28px; height: 28px;
  border-radius: 999px;
  border: 1px solid var(--rcv-border);
  background: transparent;
  color: var(--rcv-text);
  cursor: pointer;
}
.cols-close:hover{ background: rgba(255,255,255,.06); }

.cols-panel__body{
  display:grid; grid-template-columns: 1fr; gap:6px;
  max-height: 48vh; overflow:auto;
  padding: 4px 2px;
}

/* Ligne de colonne */
.cols-row{
  display:flex; align-items:center; gap:10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  transition: background .12s ease, border-color .12s ease;
  border: 1px solid transparent;
  color: var(--rcv-text);
}
.cols-row:hover{
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.06);
}

/* Checkbox aux couleurs du thème (supporté par les navigateurs récents) */
.cols-row input[type="checkbox"]{
  accent-color: var(--rcv-accent);
  width: 16px; height: 16px;
}

/* Pied de panneau + boutons plus compacts */
.cols-panel__footer{
  display:flex; justify-content:space-between; align-items:center; margin-top:10px;
}
.cols-panel .btn{
  padding: 8px 12px;           /* compact */
  border-radius: 10px;
  font-size: 13px;
}
.cols-panel .btn-ghost{
  background: transparent; border-color: var(--rcv-border);
}
.cols-panel .btn-ghost:hover{ background: rgba(255,255,255,.06); }

/* Scrollbar discrète (WebKit) */
.cols-panel__body::-webkit-scrollbar{ width: 8px; }
.cols-panel__body::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.15);
  border-radius: 999px;
}
.cols-panel__body::-webkit-scrollbar-track{ background: transparent; }

/* Pleine largeur pour le Dashboard */
.container.container--wide{
  max-width: none;   /* annule le 1200px */
  width: 100%;
  margin: 24px 0;    /* supprime le centrage horizontal */
  padding: 0 24px;   /* garde un peu d’air à gauche/droite */
}
@media (min-width: 1600px){
  .container.container--wide{ padding: 0 32px; }
}

/* Toast notifications (haut droite) */
#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 240px;
  max-width: 420px;
  padding: 10px 12px;
  border-radius: 6px;
  color: #fff;
  background: #2e7d32; /* success */
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease;
  font-size: 14px;
}
.toast.visible {
  opacity: 1;
  transform: translateY(0);
}
.toast.error { background: #c62828; }
.toast.info { background: #1976d2; }
.toast.sticky { position: relative; }

/* Petit spinner pour l'état "enregistrement..." */
.toast .spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Grade badges */
.grade{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  white-space: nowrap;
  text-align: center;
}

/* Base (vert) */
.grade[data-grade="base" i]{
  background: rgba(46,204,113,.12);
  color: #8ef0b3;
  border-color: rgba(46,204,113,.35);
}

/* Gold (jaune) */
.grade[data-grade="gold" i]{
  background: rgba(241,196,15,.12);
  color: #ffe28a;
  border-color: rgba(241,196,15,.35);
}

/* Platinium (bleu/bleu clair) */
.grade[data-grade="platinium" i],
.grade[data-grade="platinum" i]{
  background: rgba(110,168,254,.14);
  color: #cfe3ff;
  border-color: rgba(110,168,254,.4);
}

/* Barre au-dessus du tableau (sélecteur par page à droite) */
.table-toolbar{ display:flex; align-items:center; gap:10px; margin:8px 0 8px; }
.table-toolbar .spacer{ flex:1; }
.table-toolbar .per-page{ display:inline-flex; align-items:center; gap:8px; color:var(--rcv-muted); font-size:12px; }
.table-toolbar .per-page label{ margin:0; color:var(--rcv-muted); }
.table-toolbar .per-page select{ min-width:90px; }

/* Pager bas */
.pager{ display:flex; align-items:center; justify-content:center; gap:10px; margin-top:10px; }
.pager__info{ color:var(--rcv-muted); font-size:12px; }
.pager .btn[disabled]{ opacity:.5; cursor:not-allowed; }

/* === Barre de navigation (plus grande et claire) === */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  min-height: 64px;                 /* barre plus haute */
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(150%) blur(8px);
  -webkit-backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid #e9e9e9;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;                      /* cible tactile confortable */
  height: 44px;
  font-size: 28px;                  /* émojis plus grands */
  line-height: 1;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  transition: transform 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.nav a:hover {
  background: #f3f3f3;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06) inset;
  transform: translateY(-1px);
}

.nav a:active {
  transform: translateY(0);
}

.nav a:focus-visible {
  outline: 2px solid #4c9ffe;
  outline-offset: 2px;
}

.nav a[aria-current="page"] {
  background: #eef5ff;
  box-shadow: 0 0 0 1px #d6e7ff inset;
}

/* Compact sur très petits écrans */
@media (max-width: 420px) {
  .nav {
    gap: 10px;
    padding: 10px 12px;
    min-height: 56px;
  }
  .nav a {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
  .nav {
    background: rgba(20, 20, 20, 0.65);
    border-bottom-color: #2a2a2a;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  }
  .nav a:hover {
    background: #2a2a2a;
  }
  .nav a[aria-current="page"] {
    background: #1e2a3a;
    box-shadow: 0 0 0 1px #2a3b54 inset;
  }
}

/* === NAVBAR XL (forte priorité) === */
body .nav.nav--xl {
  position: sticky;
  top: 0;
  z-index: 9999;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  padding: 14px 24px !important;
  min-height: 76px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  border-bottom: 1px solid #dfe7f1;
  box-shadow: 0 8px 28px rgba(0,0,0,0.06);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}

body .nav.nav--xl a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px !important;
  height: 60px !important;
  font-size: 38px !important;     /* émojis très visibles */
  line-height: 1;
  text-decoration: none;
  color: inherit;
  border-radius: 14px;
  transition: transform 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

body .nav.nav--xl a:hover {
  background: #eff4ff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06) inset;
  transform: translateY(-1px);
}

body .nav.nav--xl a:active {
  transform: translateY(0);
}

body .nav.nav--xl a:focus-visible {
  outline: 2px solid #4c9ffe;
  outline-offset: 3px;
}

body .nav.nav--xl a[aria-current="page"] {
  background: #e6f0ff;
  box-shadow: 0 0 0 2px #cfe2ff inset;
}

/* Ultra-compact si < 380px */
@media (max-width: 380px) {
  body .nav.nav--xl {
    gap: 12px;
    padding: 10px 12px !important;
    min-height: 64px !important;
  }
  body .nav.nav--xl a {
    width: 48px !important;
    height: 48px !important;
    font-size: 30px !important;
  }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
  body .nav.nav--xl {
    background: rgba(20, 20, 20, 0.7);
    border-bottom-color: #2a2a2a;
    box-shadow: 0 8px 28px rgba(0,0,0,0.35);
  }
  body .nav.nav--xl a:hover {
    background: #2a2a2a;
  }
  body .nav.nav--xl a[aria-current="page"] {
    background: #1e2a3a;
    box-shadow: 0 0 0 2px #2a3b54 inset;
  }
}

/* === NAVBAR – thème sombre, subtil et lisible === */
:root {
  --nav-bg: rgba(12, 14, 20, 0.80);
  --nav-border: #1f2532;
  --nav-hover: #1a2130;
  --nav-active-bg: rgba(80, 130, 255, 0.14);
  --nav-active-ring: rgba(80, 130, 255, 0.35);
  --nav-height: 56px;
  --nav-icon-size: 26px;
}

body .nav.nav--dark {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  min-height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

/* largeur contenue comme le reste de la page */
body .nav.nav--dark { max-width: 1280px; margin: 0 auto; }

body .nav.nav--dark a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: var(--nav-icon-size);
  line-height: 1;
  color: #e6e8ee;
  text-decoration: none;
  border-radius: 10px;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

body .nav.nav--dark a:hover {
  background: var(--nav-hover);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04) inset;
}

body .nav.nav--dark a[aria-current="page"] {
  background: var(--nav-active-bg);
  box-shadow: 0 0 0 1px var(--nav-active-ring) inset;
}

body .nav.nav--dark a:focus-visible {
  outline: 2px solid #5c8dff;
  outline-offset: 2px;
}

/* Responsive fin */
@media (max-width: 420px) {
  body .nav.nav--dark {
    gap: 10px;
    padding: 8px 12px;
    min-height: 52px;
  }
  body .nav.nav--dark a {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
}

/* Mode sombre déjà natif, juste ajuster le contraste si le système force dark */
@media (prefers-color-scheme: dark) {
  body .nav.nav--dark {
    background: rgba(10,12,18,0.82);
    border-bottom-color: #202636;
  }
}

/* Cache toute barre locale placée après le nouveau header fusionné */
.app-header ~ .header,
.app-header ~ .topbar,
.app-header ~ .navbar,
.app-header ~ .brand,
.app-header ~ .brand-bar,
.app-header ~ .logo-bar {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
}

/* === Header (logo + navbar intégrée) === */
:root {
  --hdr-bg: rgba(12,14,20,0.85);
  --hdr-border: #1f2532;
  --hdr-maxw: 1280px;
  --icon-size: 26px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--hdr-bg);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--hdr-border);
}

.app-header__inner {
  margin: 0 auto;
  max-width: var(--hdr-maxw);
  padding: 10px 16px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Marque */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-badge {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: #26d07c; color: #0c0e14; font-weight: 800; font-size: 12px;
}
.brand-name { color: #e6e8ee; font-weight: 700; letter-spacing: 0.3px; }

/* Nav icônes */
.header-nav {
  display: flex; align-items: center; gap: 12px;
}
.header-nav a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px;
  color: #e6e8ee; text-decoration: none; font-size: var(--icon-size);
  transition: background-color 140ms ease, box-shadow 140ms ease;
}
.header-nav a:hover { background: #1a2130; box-shadow: 0 0 0 1px rgba(255,255,255,0.04) inset; }
.header-nav a[aria-current="page"] { background: rgba(80,130,255,0.14); box-shadow: 0 0 0 1px rgba(80,130,255,0.35) inset; }

@media (max-width: 420px) {
  .app-header__inner { padding: 8px 12px; min-height: 52px; }
  .header-nav a { width: 40px; height: 40px; font-size: 24px; }
}

/* Supprime toute ancienne barre locale juste après le nouveau header */
.app-header + .header,
.app-header + .topbar,
.app-header + .brand,
.app-header + .brand-bar,
.app-header + .logo-bar,
.app-header + .toolbar,
.app-header + .nav,
.app-header + .navbar {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
}


