/* ============================================================
   Panel admin Magalie VAÉ — Refonte élégante
   Cohérent avec le site public : Outfit, palette crème, minimal
   ============================================================ */

:root {
  --bg-cream:   #FAF7F2;
  --bg-white:   #ffffff;
  --bg-panel:   #FDFBF6;
  --ink:        #1F3A52;
  --ink-soft:   #4a5b70;
  --ink-dim:    #6d7e93;
  --ink-mute:   #8b9aad;
  --accent:     #2d5279;
  --accent-lt:  #8ab1cd;
  --accent-gold:#d4a418;
  --danger:     #b25a5a;
  --success:    #6b8e69;
  --border:     rgba(31,58,82,0.08);
  --border-hi:  rgba(31,58,82,0.14);
  --shadow-sm:  0 1px 2px rgba(31,58,82,0.04);
  --shadow-md:  0 4px 12px rgba(31,58,82,0.06);
  --shadow-lg:  0 12px 32px rgba(31,58,82,0.10);
  --radius:     4px;
  --radius-lg:  8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-cream);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--ink); }

/* ============================================================
   HEADER
   ============================================================ */
.admin-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 32px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  padding-right: 20px;
  border-right: 1px solid var(--border);
  transition: none;
}
.admin-brand:hover { color: var(--ink); }

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--ink) 100%);
  color: white;
  border-radius: 50%;
  font-weight: 200;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}
.brand-logo em {
  color: var(--accent-gold);
  font-style: italic;
  font-weight: 300;
  margin-left: -1px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-text strong {
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.brand-text span {
  color: var(--ink-mute);
  font-weight: 300;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* ============================================================
   NAVIGATION (groupes)
   ============================================================ */
.admin-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: thin;
}
.admin-nav::-webkit-scrollbar { height: 4px; }
.admin-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nav-group {
  display: flex;
  gap: 2px;
  align-items: center;
}

.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 6px;
  flex-shrink: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0.005em;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  position: relative;
}
.nav-link:hover {
  background: rgba(45,82,121,0.06);
  color: var(--ink);
}
.nav-link.active {
  background: var(--accent);
  color: white;
  font-weight: 500;
}
.nav-link.active:hover {
  background: var(--ink);
  color: white;
}
.nav-icon {
  font-size: 0.95rem;
  opacity: 0.65;
  line-height: 1;
}
.nav-link.active .nav-icon {
  opacity: 1;
}
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  background: var(--danger);
  color: white;
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: 10px;
  margin-left: 2px;
  letter-spacing: 0;
}
.nav-link.active .nav-badge {
  background: rgba(255,255,255,0.25);
  color: white;
}

/* ============================================================
   USER
   ============================================================ */
.admin-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 20px;
  border-left: 1px solid var(--border);
}
.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: right;
}
.user-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
}
.user-role {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--success);
  font-weight: 500;
  margin-top: 1px;
}
.btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-mute);
  font-size: 1rem;
  transition: all 0.15s;
}
.btn-logout:hover {
  background: rgba(178,90,90,0.06);
  color: var(--danger);
  border-color: rgba(178,90,90,0.25);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.admin-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 32px 60px;
}

.admin-main h1 {
  font-size: 2rem;
  font-weight: 200;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 14px;
}
.admin-main h1 em {
  color: var(--accent);
  font-style: italic;
  opacity: 0.85;
}
.admin-main h2 {
  font-size: 1.35rem;
  font-weight: 300;
  letter-spacing: -0.01em;
  margin: 32px 0 14px;
  color: var(--ink);
}
.admin-main h3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 24px 0 12px;
}

.admin-main .lead {
  color: var(--ink-dim);
  font-size: 0.98rem;
  font-weight: 300;
  margin: 0 0 32px;
  max-width: 720px;
  line-height: 1.55;
}

/* ============================================================
   CARDS & PANELS
   ============================================================ */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 10px;
}
.card h3 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}

/* Grid de tuiles */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 24px;
}
.tile {
  display: block;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  color: inherit;
  transition: transform 0.2s cubic-bezier(0.16,1,0.3,1), box-shadow 0.2s, border-color 0.2s;
  position: relative;
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hi);
  color: inherit;
  text-decoration: none;
}
.tile-icon {
  font-size: 1.5rem;
  color: var(--accent);
  opacity: 0.5;
  margin-bottom: 12px;
  display: block;
}
.tile-title {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 4px;
}
.tile-desc {
  color: var(--ink-dim);
  font-size: 0.87rem;
  font-weight: 300;
  line-height: 1.45;
  margin: 0;
}
.tile-count {
  position: absolute;
  top: 20px;
  right: 22px;
  font-size: 1.3rem;
  font-weight: 200;
  color: var(--ink-mute);
  letter-spacing: -0.02em;
}

/* ============================================================
   FORMS
   ============================================================ */
label, .form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="date"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-white);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent-lt);
  box-shadow: 0 0 0 3px rgba(138,177,205,0.15);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.form-field { margin-bottom: 20px; }
.form-help {
  font-size: 0.78rem;
  color: var(--ink-mute);
  margin-top: 6px;
  font-weight: 300;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn, button.btn, input[type="submit"], input[type="button"] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
}
.btn:hover { background: var(--ink); transform: translateY(-1px); text-decoration: none; color: white; }
.btn:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--border-hi);
}
.btn-outline:hover { background: rgba(45,82,121,0.05); color: var(--ink); }

.btn-success {
  background: var(--success);
}
.btn-success:hover { background: #4a6349; }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(178,90,90,0.25);
}
.btn-danger:hover { background: rgba(178,90,90,0.06); color: var(--danger); }

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 20px;
  border-left: 3px solid;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert.success { background: rgba(107,142,105,0.08); border-color: var(--success); color: #3a5a35; }
.alert.error, .alert.danger { background: rgba(178,90,90,0.08); border-color: var(--danger); color: #7a3535; }
.alert.info { background: rgba(45,82,121,0.06); border-color: var(--accent); color: var(--ink-soft); }
.alert.warning { background: rgba(212,164,24,0.08); border-color: var(--accent-gold); color: #7a5f10; }

/* ============================================================
   TABLES
   ============================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
th {
  background: var(--bg-panel);
  font-weight: 500;
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(45,82,121,0.02); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 11px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-success { background: rgba(107,142,105,0.15); color: #3a5a35; }
.badge-danger  { background: rgba(178,90,90,0.15); color: #7a3535; }
.badge-info    { background: rgba(45,82,121,0.12); color: var(--accent); }
.badge-mute    { background: rgba(139,154,173,0.15); color: var(--ink-mute); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .admin-header { flex-wrap: wrap; padding: 12px 20px; }
  .admin-nav { order: 3; width: 100%; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
  .nav-divider { display: none; }
  .nav-link .nav-label { font-size: 0.82rem; }
  .admin-main { padding: 30px 20px 50px; }
  .form-row { grid-template-columns: 1fr; }
}

/* ============================================================
   PAGE HEADER (titre de section avec eyebrow italique)
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.page-eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 500;
}
.page-header h1 {
  font-size: 2rem;
  font-weight: 200;
  text-transform: lowercase;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0 0 10px;
  color: var(--ink);
}
.page-header h1 em {
  font-style: italic;
  color: var(--accent);
  opacity: 0.85;
  font-weight: 300;
}
.page-header .lead {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 640px;
  font-weight: 300;
}

/* ============================================================
   SETTINGS CARDS (cartes de réglages)
   ============================================================ */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
}
.settings-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.settings-card:hover {
  box-shadow: var(--shadow-md);
}
.settings-card-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}
.settings-card-header h2 {
  font-size: 1.15rem;
  font-weight: 300;
  text-transform: lowercase;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--ink);
}
.settings-card-header h2 em {
  font-style: italic;
  color: var(--accent);
  opacity: 0.85;
  font-weight: 400;
}
.settings-card-header p {
  margin: 0;
  color: var(--ink-mute);
  font-size: 0.85rem;
  line-height: 1.5;
  font-weight: 300;
}
.settings-card-info { background: var(--bg-panel); }

.settings-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Champ individuel */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="url"],
.field input[type="number"] {
  padding: 10px 14px;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  background: white;
  font-family: inherit;
  font-size: 0.94rem;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,82,121,0.12);
}
.field-help {
  font-size: 0.78rem;
  color: var(--ink-mute);
  font-style: italic;
  font-weight: 300;
}

/* Groupe adresse */
.field-group {
  padding: 18px 20px;
  background: var(--bg-panel);
  border-radius: var(--radius);
  border: 1px dashed var(--border-hi);
}
.field-group-title {
  font-size: 0.78rem;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  margin-bottom: 14px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
.field-row:last-child { margin-bottom: 0; }
.field-row .field-small { max-width: 140px; }
@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
}

/* ============================================================
   TOGGLE SWITCH (interrupteur type iOS)
   ============================================================ */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  background: var(--bg-panel);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.toggle-row:hover { background: rgba(45,82,121,0.03); }
.toggle-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.toggle-info strong {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
}
.toggle-info span {
  color: var(--ink-mute);
  font-size: 0.82rem;
  font-weight: 300;
}
.toggle-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--ink-mute);
  border-radius: 12px;
  transition: background 0.25s cubic-bezier(0.16,1,0.3,1);
  flex-shrink: 0;
}
.toggle-switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-row input:checked + .toggle-switch {
  background: var(--accent);
}
.toggle-row input:checked + .toggle-switch::before {
  transform: translateX(20px);
}

/* Barre "enregistrer" flottante en bas */
.settings-save-bar {
  display: flex;
  justify-content: flex-end;
  padding: 22px 32px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: sticky;
  bottom: 20px;
  box-shadow: var(--shadow-md);
  z-index: 5;
}
.btn-primary {
  padding: 12px 26px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.94rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  font-family: inherit;
}
.btn-primary:hover {
  background: var(--ink);
  transform: translateY(-1px);
}

/* ============================================================
   INFO GRID (grille d'informations système)
   ============================================================ */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.info-label {
  font-size: 0.72rem;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.info-value {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
  font-family: Consolas, Menlo, monospace;
}

/* Alert (message d'action réussie) */
.alert {
  padding: 14px 20px;
  border-radius: var(--radius);
  margin-bottom: 22px;
  font-size: 0.92rem;
  font-weight: 400;
}
.alert.success {
  background: rgba(107,142,105,0.1);
  color: #3a5a35;
  border-left: 3px solid var(--success);
}
.alert.error {
  background: rgba(178,90,90,0.1);
  color: #7a3535;
  border-left: 3px solid var(--danger);
}
