:root {
    --bg: #f5f7fb;
    --bg-alt: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --primary: #2563eb;
    --primary-soft: rgba(37, 99, 235, 0.1);
    --danger: #ef4444;
    --success: #10b981;
    --border: #e5e7eb;
    --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.08);
    --radius-lg: 18px;
}

/* Mode sombre */
body.dark {
    --bg: #020617;
    --bg-alt: #020617;
    --text: #f9fafb;
    --text-muted: #9ca3af;
    --primary-soft: rgba(37, 99, 235, 0.25);
    --border: #1f2937;
    --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.75);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #dbeafe 0, #f5f7fb 45%, #eef2ff 100%);
    color: var(--text);
    min-height: 100vh;
}

body.dark {
    background: radial-gradient(circle at top left, #0f172a 0, #020617 50%, #000 100%);
}

a {
    text-decoration: none;
    color: inherit;
}

/* ------- NAVBAR ------- */

header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

body.dark header {
  background: #020617;
  border-bottom: 1px solid #1f2937;
}


.nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.9rem 1.3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.logo span.icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.logo-text strong {
    font-size: 0.9rem;
}

.logo-text small {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    gap: 0.9rem;
    font-size: 0.9rem;
}

.nav-links a {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    color: var(--text-muted);
    transition: 0.18s;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--primary-soft);
    color: var(--primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ------- BOUTONS ------- */

.btn {
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: 0.18s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.45);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.55);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: rgba(148, 163, 184, 0.12);
}

/* ------- LAYOUT GLOBAL ------- */

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1.3rem 4rem;
}

section {
    margin-top: 2.5rem;
}

.section-title {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
    font-weight: 700;
}

.section-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* ------- HERO (index) ------- */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2.4fr);
    gap: 1.8rem;
    margin-top: 1.3rem;
}

.hero-left h1 {
    font-size: 2.15rem;
    line-height: 1.1;
    margin-bottom: 0.7rem;
}

.hero-left h1 span {
    background: linear-gradient(120deg, #2563eb, #22c55e);
    background-clip: text;           /* propriété standard */
    -webkit-background-clip: text;   /* compatibilité WebKit (Chrome, Safari) */
    color: transparent;
}


.hero-left p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.4rem;
}

.hero-badges .badge {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);              /* texte foncé en thème clair */
}

body.dark .hero-badges .badge {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);              /* texte clair en thème sombre */
}


.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.hero-right {
    background: radial-gradient(circle at top left, #2563eb1f, transparent 60%),
    radial-gradient(circle at bottom, #22c55e22, transparent 60%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.hero-right-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.hero-os-tabs {
    display: inline-flex;
    padding: 0.15rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
}

body.dark .hero-os-tabs {
    background: rgba(15, 23, 42, 0.9);
}

.hero-os-tabs button {
    border-radius: 999px;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.72rem;
    font-size: 0.78rem;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.hero-os-tabs button.active {
    background: var(--primary);
    color: #f9fafb;
}

.hero-checklist {
    font-size: 0.8rem;
    display: grid;
    gap: 0.4rem;
}

.hero-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

.hero-checklist-item span.icon {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.hero-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    margin-top: 0.3rem;
}

.hero-mini-card {
    border-radius: 12px;
    padding: 0.4rem 0.55rem;
    background: rgba(15, 23, 42, 0.04);
    font-size: 0.75rem;
}

body.dark .hero-mini-card {
    background: rgba(15, 23, 42, 0.9);
}

.hero-mini-card strong {
    display: block;
}

.hero-os-content {
    display: none;
}

.hero-os-content.active {
    display: block;
}

/* ------- CARTES / GRILLES ------- */

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    padding: 0.9rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    font-size: 0.85rem;
}

body.dark .card {
    background: rgba(15, 23, 42, 0.96);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.card-title {
    font-weight: 600;
    font-size: 0.92rem;
}

.card-pill {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
}

.card ul {
    margin-top: 0.4rem;
    padding-left: 1rem;
    color: var(--text-muted);
}

.card ul li {
    margin-bottom: 0.25rem;
}

.card-footer-note {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ------- GUIDES OS ------- */

.os-guides {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.os-card-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.os-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: var(--primary-soft);
}

.step-list {
    margin-top: 0.4rem;
    padding-left: 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.step-list li {
    margin-bottom: 0.25rem;
}

.tip {
    margin-top: 0.4rem;
    font-size: 0.78rem;
    color: var(--success);
}

/* ------- FAQ ------- */

.faq-list {
    display: grid;
    gap: 0.6rem;
}

.faq-item {
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    padding: 0.7rem 0.9rem;
    cursor: pointer;
}

body.dark .faq-item {
    background: rgba(15, 23, 42, 0.96);
}

.faq-q {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.faq-a {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: none;
}

.faq-item.open .faq-a {
    display: block;
}

.faq-item .chevron {
    transition: transform 0.18s;
}

.faq-item.open .chevron {
    transform: rotate(90deg);
}

/* ------- CONTACT ------- */

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 1rem;
}

.contact-card {
    border-radius: var(--radius-lg);
    padding: 0.9rem;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-soft);
    font-size: 0.85rem;
}

body.dark .contact-card {
    background: rgba(15, 23, 42, 0.96);
}

.contact-card label {
    display: block;
    font-size: 0.78rem;
    margin-top: 0.5rem;
    margin-bottom: 0.1rem;
}

.contact-card input,
.contact-card textarea,
.contact-card select {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
    background: rgba(248, 250, 252, 0.9);
    color: var(--text);
}

body.dark .contact-card input,
body.dark .contact-card textarea,
body.dark .contact-card select {
    background: #020617;
    color: var(--text);
}

.contact-card textarea {
    resize: vertical;
    min-height: 90px;
}

.contact-side {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.contact-side ul {
    margin-top: 0.4rem;
    padding-left: 1rem;
}

.contact-side li {
    margin-bottom: 0.3rem;
}

.form-status {
    margin-top: 0.6rem;
    font-size: 0.8rem;
}

.form-status.success {
    color: var(--success);
}

.form-status.error {
    color: var(--danger);
}

/* ------- SCROLL TOP BTN ------- */

#scrollTopBtn {
    position: fixed;
    right: 1.2rem;
    bottom: 1.2rem;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: none;
    background: var(--primary);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.6);
    font-size: 1.1rem;
}

/* ------- UTIL ------- */

.muted {
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ------- RESPONSIVE ------- */

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
    }
    .os-guides {
        grid-template-columns: 1fr;
    }
    .grid-3 {
        grid-template-columns: 1fr;
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .nav {
        flex-wrap: wrap;
        gap: 0.6rem;
    }
    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* --- Effet lumière qui suit la souris sur les boutons bleus --- */

.btn-primary,
.help-btn {
    position: relative;
    overflow: hidden;
}
/* Halo lumineux */
.btn-primary::before,
.help-btn::before {
    content: "";
    position: absolute;
    inset: -60%;
    pointer-events: none;
    background: radial-gradient(
        circle at var(--mx, 50%) var(--my, 50%),
        rgba(255, 255, 255, 0.45),
        transparent 60%
    );
    opacity: 0;
    transition: opacity 0.25s ease-out;
}

/* Quand on survole, on voit le halo */
.btn-primary:hover::before,
.help-btn:hover::before {
    opacity: 1;
}
.section h2 {
  margin-bottom: 1rem;
}

.section .card h3 {
  margin-bottom: 0.4rem;
}

.section .card + .card {
  margin-top: 0.8rem;
}

:target {
  scroll-margin-top: 120px;
}

.screenshots-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.preview-item {
  position: relative;
  width: 80px;
  height: 80px;
}

.preview-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  cursor: pointer;
}

.btn-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.contact-card .btn-loading {
  position: relative;
  pointer-events: none;
}

.contact-card .btn-loading-text {
  opacity: 1;            /* visible au repos */
  transition: opacity 0.2s;
}

.contact-card .btn-spinner {
  position: absolute;
  inset: 0;
  display: none;          /* caché au départ */
  align-items: center;
  justify-content: center;
}

.contact-card .spinner-ring {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ffffff;
  animation: spinner-rotate 0.8s linear infinite;
}

/* Loader pour le bouton Se connecter (admin) */
.admin-login-card .btn-loading {
  position: relative;
}

.admin-login-card .btn-loading-text {
  opacity: 1;
  transition: opacity 0.2s;
}

.admin-login-card .btn-spinner {
  position: absolute;
  inset: 0;
  display: none;              /* caché au départ */
  align-items: center;
  justify-content: center;
}

.admin-login-card .spinner-ring {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ffffff;
  animation: spinner-rotate 0.8s linear infinite;
}

/* animation commune contact + admin */
@keyframes spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}


.admin-login {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 90px); /* plein écran sous la navbar */
}

.admin-login-card {
  max-width: 420px;
  width: 100%;
  padding: 1.5rem 1.8rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
}

body.dark .admin-login-card {
  background: rgba(15, 23, 42, 0.96);
}

.admin-login-card h1 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.error-message {
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.admin-field span {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.admin-field input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
  background: rgba(248, 250, 252, 0.9);
  color: var(--text);
}

body.dark .admin-field input {
  background: #020617;
  color: var(--text);
}

.admin-submit {
  width: 100%;
  justify-content: center;
  margin-top: 0.4rem;
}

/* Anneau bleu qui pulse autour du bouton Admin */
.admin-glow {
  position: relative;
  overflow: visible;
}

.admin-glow::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 2px solid rgba(37, 99, 235, 0.85);
  box-shadow:
    0 0 18px rgba(37, 99, 235, 0.9),
    0 0 32px rgba(37, 99, 235, 0.7);
  pointer-events: none;
}

.admin-glow::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  border: 3px solid rgba(56, 189, 248, 0.9);
  box-shadow:
    0 0 22px rgba(56, 189, 248, 0.9),
    0 0 40px rgba(59, 130, 246, 0.9);
  opacity: 0.4;
  animation: admin-echo-pulse 1.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes admin-echo-pulse {
  0%   { opacity: 0.25; box-shadow: 0 0 16px rgba(56,189,248,0.6), 0 0 28px rgba(37,99,235,0.7); }
  50%  { opacity: 0.9;  box-shadow: 0 0 26px rgba(56,189,248,1),   0 0 46px rgba(37,99,235,1);   }
  100% { opacity: 0.25; box-shadow: 0 0 16px rgba(56,189,248,0.6), 0 0 28px rgba(37,99,235,0.7); }
}

.loading-admin-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.admin-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

/* Fond de la page de loading admin en clair */
.loading-admin-page {
  background: radial-gradient(circle at top left, #dbeafe 0, #f5f7fb 45%, #eef2ff 100%);
  color: var(--text);
}

/* En mode sombre, on garde ton fond noir/bleu actuel */
body.dark .loading-admin-page {
  background: radial-gradient(circle at center, #020617 0, #000000 100%);
  color: #e5e7eb;
}

.admin-ring {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: radial-gradient(circle at top, #0ea5e9, transparent 55%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-ring span {
  position: relative;
  z-index: 2;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  font-size: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.admin-ring .ring-circle {
  position: absolute;
  inset: 10px;
  border-radius: 999px;
  border: 3px solid rgba(37, 99, 235, 0.25);
  border-top-color: #38bdf8;
  border-right-color: #2563eb;
  animation: admin-ring-spin 1s linear infinite;
  box-shadow:
    0 0 18px rgba(59, 130, 246, 0.7),
    0 0 30px rgba(56, 189, 248, 0.6);
}

@keyframes admin-ring-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== STRUCTURE DASHBOARD V2 ===== */

.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
}

.admin-dashboard h1 {
  font-size: 2.1rem;
  margin: 0 0 0.3rem;
}

.admin-dashboard .section-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: #9ca3af;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

/* Grille 2x2 : 4 cartes */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.8rem;
}

/* Cartes dashboard admin */
.admin-card {
  background: var(--bg-alt);
  border-radius: 18px;
  padding: 1rem 1.2rem 1.2rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
  color: var(--text);
}

body.dark .admin-card {
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.7);
}


.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.admin-card-header h2 {
  font-size: 1.05rem;
  margin: 0;
}

.admin-card-body {
  font-size: 0.86rem;
}

.admin-card-footer {
  margin-top: 0.8rem;
}

/* Badge "20 derniers" */
.badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.15);
  color: #e5e7eb;
}

/* Bouton petit format */
.btn-small {
  font-size: 0.8rem;
  padding: 0.2rem 0.7rem;
}

/* Zone scrollable (logs / messages) */
.scrollable {
  max-height: 260px;
  overflow: auto;
  font-size: 0.78rem;
  line-height: 1.4;
}

/* Plus de hauteur pour les messages contact */
.admin-card:nth-of-type(3) .scrollable {
  max-height: 430px;
}

.log-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.log-list li {
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(148,163,184,0.25);
}

/* Stats */
.stat-big {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  margin-top: 0.9rem;
}

.stat-block h3 {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

/* Bloc admin serveur en 2 colonnes */
.two-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.7fr);
  gap: 1rem;
  margin-top: 0.5rem;
}

.sub-card h3 {
  font-size: 0.95rem;
  margin: 0 0 0.3rem;
}

/* Inputs admin (reprend ton style) */
.admin-field input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
  background: rgba(248, 250, 252, 0.9);
  color: var(--text);
}

body.dark .admin-field input {
  background: #020617;
  color: var(--text);
}

.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-submit {
  width: 100%;
  justify-content: center;
  margin-top: 0.2rem;
}

/* Responsive */
@media (max-width: 900px) {
  .admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Barre de nav sticky en haut */
header {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* On laisse un espace sous le header pour que le dashboard ne passe pas dessous */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 5.5rem 2rem 3rem;  /* 5.5rem au lieu de 2rem en haut */
}

/* Sécurité : le dashboard ne doit jamais passer devant le header */
.admin-dashboard,
.admin-grid,
.admin-card {
  position: relative;
  z-index: 1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
}

.modal {
  max-width: 700px;
  width: 100%;
  background: var(--bg-alt);
  border-radius: 18px;
  padding: 1.2rem 1.4rem 1.3rem;
  box-shadow: 0 22px 55px rgba(15,23,42,0.9);
  color: var(--text);
}

body.dark .modal {
  background: rgba(15,23,42,0.98);
  color: #e5e7eb;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.modal-header h2 {
  font-size: 1.1rem;
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.modal-body {
  font-size: 0.9rem;
  line-height: 1.5;
}

.modal-images {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.modal-images img {
  max-width: 180px;
  max-height: 140px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.5);
  object-fit: cover;
}

/* Empêcher le scroll de fond quand la modal est ouverte */
body.modal-open {
  overflow: hidden;
}

/* Rendre chaque message cliquable visuellement */
.contact-item {
  cursor: pointer;
}

/* Cacher la modal quand elle a l'attribut hidden */
.modal-backdrop[hidden] {
  display: none !important;
}

.admin-dashboard .section-subtitle,
.admin-card .card-footer-note,
.admin-card .muted {
  color: var(--text-muted);
}

/* Badge "20 derniers" dans le dashboard */
.admin-card-header .badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--primary);
  color: #f9fafb;
}

.admin-card-backup .admin-card-body .admin-backup-btn {
  margin-top: 0.8rem;
}

/* Ligne message + bouton Répondre dans le dashboard */
.log-list .contact-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
}

.contact-item-main {
  flex: 1;
}

.contact-item-actions .reply-btn {
  white-space: nowrap;
  margin-top: 0.2rem;
}

/* Texte du message dans la modale */
.modal-message-text {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.8rem;
}

/* Carte de réponse admin */
.reply-card {
  margin-top: 0.6rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

body.dark .reply-card {
  background: rgba(15, 23, 42, 0.98);
}

.reply-card-header {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.reply-card-body {
  padding: 0.8rem 0.9rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Textarea harmonisé avec tes inputs admin */
.reply-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.5rem 0.6rem;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 110px;
  background: rgba(248, 250, 252, 0.9);
  color: var(--text);
}

body.dark .reply-form textarea {
  background: #020617;
  color: var(--text);
}

.reply-card-footer {
  padding: 0.6rem 0.9rem 0.7rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.reply-card-footer .form-status {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.reply-panel {
  width: 100%;
  margin-top: 0.9rem;
  border-radius: 16px;
  /* soit très légère : */
  /* border: 1px solid rgba(15,23,42,0.6); */
  background: var(--bg-alt);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

/* Fond suit le thème (var(--bg-alt) est déjà géré par body.dark) */
body.dark .reply-panel {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.8);
}

/* En-tête de la carte */
.reply-panel-header {
  padding: 0.75rem 1rem 0.6rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.reply-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.reply-title .dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #22c55e, #4ade80);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}

.reply-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Corps de la carte : champs plein largeur */
.reply-panel-body {
  padding: 0.85rem 1rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

/* Inputs & textarea harmonisés */
.reply-form input[type="text"],
.reply-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.5rem 0.6rem;
  font-size: 0.9rem;
  background: rgba(248, 250, 252, 0.98);
  color: var(--text);
}

body.dark .reply-form input[type="text"],
body.dark .reply-form textarea {
  background: #020617;
  color: var(--text);
}

/* Footer : statut + bouton alignés */
.reply-panel-footer {
  padding: 0.6rem 1rem 0.7rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.reply-panel-footer .form-status {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Sur petits écrans, bouton passe dessous pour éviter que ça casse */
@media (max-width: 600px) {
  .reply-panel-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .reply-panel-footer .btn-small {
    width: 100%;
    justify-content: center;
  }
}

.reply-panel-footer {
  padding: 0.6rem 1rem 0.7rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.reply-footer-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.reply-panel-footer .form-status {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}
