/* =============================================
   LA PELLICULE DE MARION — CRM MARIÉS
   Esthétique : Rose poudré / Blanc / Or
   ============================================= */

:root {
  /* Couleurs principales — personnalisables */
  --accent:       #c9956e;   /* Or rosé */
  --accent-light: #f5e6d8;   /* Rose poudré clair */
  --accent-dark:  #a67854;   /* Or foncé */
  --accent-glow:  rgba(201,149,110,0.15);

  /* Fond */
  --bg:           #fdf8f5;   /* Blanc cassé chaud */
  --bg-2:         #ffffff;   /* Blanc pur */
  --bg-3:         #faf4ef;   /* Rose très pâle */
  --border:       #e8d5c4;   /* Beige rosé */
  --border-light: #f0e0d0;

  /* Texte */
  --text:         #2c1810;   /* Brun très foncé */
  --text-muted:   #8b6b5a;   /* Brun moyen */
  --text-faint:   #c4a99a;   /* Brun clair */

  /* Statuts */
  --green:        #6aaa7e;
  --orange:       #e8a84a;
  --red:          #d96b6b;
  --blue:         #7a9fc4;

  /* Layout */
  --sidebar-w:    240px;
  --radius:       8px;
  --radius-lg:    16px;
  --ease:         cubic-bezier(0.16, 1, 0.3, 1);

  /* Typographie */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  display: flex;
  font-size: 14px;
  line-height: 1.6;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
  -webkit-app-region: drag;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  -webkit-app-region: no-drag;
  height: 80px;
  overflow: hidden;
}

.logo-mark {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 10px 16px;
}

/* Masquer le texte logo quand image présente */
.logo-text { display: none; }

.nav-links {
  list-style: none;
  flex: 1;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  -webkit-app-region: no-drag;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  transition: all 0.15s var(--ease);
  cursor: pointer;
}

.nav-item:hover { background: var(--accent-light); color: var(--text); }

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent-dark);
  font-weight: 500;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 10px;
  width: 2px;
  height: 18px;
  background: var(--accent);
  border-radius: 1px;
}

.nav-item { position: relative; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-label { font-size: 13px; }

/* Separateur de section nav */
.nav-section {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 12px 12px 4px;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  -webkit-app-region: no-drag;
  font-size: 12px;
}

/* ══════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  height: 60px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--bg-2);
  flex-shrink: 0;
  -webkit-app-region: drag;
}

.topbar .btn, .topbar button { -webkit-app-region: no-drag; }

.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.5px;
  -webkit-app-region: no-drag;
}

.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

/* ══════════════════════════════════════
   BOUTONS
══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s var(--ease);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }

.btn-secondary { background: var(--bg-3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--accent-light); }

.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }

.btn-danger { background: transparent; color: var(--red); border: 1px solid rgba(217,107,107,0.3); }
.btn-danger:hover { background: rgba(217,107,107,0.08); }

.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ══════════════════════════════════════
   CARTES
══════════════════════════════════════ */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: 0.3px;
}

/* ══════════════════════════════════════
   FORMULAIRES
══════════════════════════════════════ */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 9px 12px;
  transition: border-color 0.15s;
  outline: none;
  -webkit-appearance: none;
}

.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-control::placeholder { color: var(--text-faint); }

textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

.form-row { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ══════════════════════════════════════
   TABLEAU
══════════════════════════════════════ */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; }

thead tr { background: var(--bg-3); border-bottom: 1px solid var(--border); }

th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

td {
  padding: 13px 14px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: var(--bg-3); }

/* ══════════════════════════════════════
   BADGES / STATUTS
══════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.badge-green   { background: rgba(106,170,126,0.15); color: #4a8a5e; }
.badge-orange  { background: rgba(232,168,74,0.15);  color: #b8822e; }
.badge-red     { background: rgba(217,107,107,0.15); color: #b85555; }
.badge-red-hot { background: rgba(217,50,50,0.15);   color: #c03030; }
.badge-gray    { background: var(--bg-3); color: var(--text-muted); }
.badge-blue    { background: rgba(122,159,196,0.15); color: #5a7fa4; }
.badge-gold    { background: rgba(201,149,110,0.2);  color: var(--accent-dark); }

/* ══════════════════════════════════════
   STATS GRID (dashboard)
══════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.15s var(--ease);
}

.stat-card[onclick] { cursor: pointer; }
.stat-card[onclick]:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(201,149,110,0.15); }

.stat-label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; }
.stat-value { font-family: var(--font-display); font-size: 32px; color: var(--text); line-height: 1; }
.stat-value.accent { color: var(--accent); }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ══════════════════════════════════════
   SECTION HEADER
══════════════════════════════════════ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
}

/* ══════════════════════════════════════
   SEARCH
══════════════════════════════════════ */
.search-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }

.search-input {
  flex: 1;
  max-width: 320px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-faint); }

/* ══════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════ */
.empty-state { text-align: center; padding: 64px 32px; }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-text { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.7; }

/* ══════════════════════════════════════
   MODAL
══════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44,24,16,0.4);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s var(--ease);
}

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 580px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.2s var(--ease);
  overflow: hidden;
}

.modal-lg { max-width: 820px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.1s;
}
.modal-close:hover { background: var(--bg-3); color: var(--text); }

.modal-body { padding: 24px; overflow-y: auto; flex: 1; }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   TOAST
══════════════════════════════════════ */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }

.toast {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.2s var(--ease);
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(44,24,16,0.12);
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--accent); }

/* ══════════════════════════════════════
   FICHE MARIE
══════════════════════════════════════ */
.fiche-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.15s var(--ease);
  cursor: pointer;
}

.fiche-card:hover { border-color: var(--accent); box-shadow: 0 4px 20px rgba(201,149,110,0.12); transform: translateY(-2px); }

.fiche-prenoms {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.fiche-date-mariage {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.countdown {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.countdown-unit {
  text-align: center;
  background: var(--accent-glow);
  border-radius: var(--radius);
  padding: 8px 12px;
  min-width: 56px;
}

.countdown-num {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}

.countdown-label {
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 3px;
}

/* ══════════════════════════════════════
   LACMAC — PAGE RDV
══════════════════════════════════════ */
.lacmac-phase {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}

.lacmac-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.lacmac-phase-icon { font-size: 22px; }

.lacmac-phase-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
}

.lacmac-phase-desc { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.lacmac-body { padding: 20px; }

.question-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}

.question-item:last-child { border-bottom: none; }

.question-num {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--accent);
  min-width: 28px;
  font-weight: 500;
}

.question-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  flex: 1;
}

.question-tip {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
}

/* ══════════════════════════════════════
   ESPACE MARIE (vue mariés)
══════════════════════════════════════ */
.espace-header {
  text-align: center;
  padding: 40px 20px 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.espace-prenoms {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 300;
  color: var(--text);
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.espace-countdown {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.espace-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

.espace-section-header {
  padding: 16px 22px;
  background: var(--accent-glow);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.espace-section-body { padding: 22px; }

.planning-row {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  align-items: flex-start;
}
.planning-row:last-child { border-bottom: none; }
.planning-time { font-family: var(--font-mono); font-size: 12px; color: var(--accent); min-width: 80px; padding-top: 2px; }
.planning-event { font-size: 13px; color: var(--text); flex: 1; }

/* ══════════════════════════════════════
   MOBILE NAV
══════════════════════════════════════ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  z-index: 50;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  -webkit-app-region: no-drag;
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .page-content { padding: 16px 12px; padding-bottom: 80px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; -webkit-app-region: no-drag; }
  .mobile-nav { display: flex; }
  .table-wrapper table, .table-wrapper thead, .table-wrapper tbody, .table-wrapper tr, .table-wrapper td { display: block; width: 100%; }
  .table-wrapper thead { display: none; }
  .table-wrapper tbody tr { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; padding: 12px; }
  .table-wrapper td { padding: 3px 0; border: none; }
  .table-wrapper td:last-child { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); display: block; }
}

/* ══════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ══════════════════════════════════════
   UTILITAIRES
══════════════════════════════════════ */
.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.text-muted { color: var(--text-muted); }
.td-mono { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }

/* ══════════════════════════════════════
   ESPACE MARIÉS — CENTRÉ
══════════════════════════════════════ */
#page-content .espace-section {
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* Tout centré dans l'espace */
#page-content .espace-section-body {
  padding: 28px 32px;
  text-align: center;
}

/* Titres et labels centrés */
#page-content .espace-section-header,
#page-content .espace-section-body h1,
#page-content .espace-section-body h2,
#page-content .espace-section-body h3,
#page-content .espace-section-body p,
#page-content .espace-section-body .form-label,
#page-content .espace-section-body .q-label,
#page-content .espace-section-body .q-sublabel {
  text-align: center;
}

/* Formulaires : champs restent lisibles à gauche mais container centré */
#page-content .espace-section-body .form-group { text-align: left; }
#page-content .espace-section-body input,
#page-content .espace-section-body textarea,
#page-content .espace-section-body select { text-align: left; }

/* Boutons centrés */
#page-content .espace-section-body button,
#page-content .espace-section-body .btn {
  margin-left: auto;
  margin-right: auto;
}

/* Planning centré */
#page-content .planning-row {
  justify-content: center;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

/* Grille centrée */
#page-content .espace-section-body > div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Photo équipe bien cadrée dans le cercle */
.team-photo {
  width: 90px;
  height: 90px;
  min-width: 90px;
  min-height: 90px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  border: 2px solid var(--border);
  display: block;
  margin: 0 auto 12px;
  background: var(--bg-3);
  overflow: hidden;
  /* Forcer le zoom pour remplir le cercle */
  -o-object-fit: cover;
  -o-object-position: center;
}

/* Conteneur photo équipe */
.team-photo-wrap {
  width: 90px;
  height: 90px;
  min-width: 90px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 12px;
  border: 2px solid var(--border);
  background: var(--bg-3);
}
.team-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.team-photo-placeholder {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 12px;
  border: 2px solid var(--border);
}

/* ══════════════════════════════════════
   MOBILE NAV — ITEMS
══════════════════════════════════════ */
.mn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 8px;
  border-radius: var(--radius);
  color: var(--text-faint);
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-body);
  transition: color 0.15s;
  flex: 1;
  -webkit-tap-highlight-color: transparent;
}
.mn-item.active { color: var(--accent); }
.mn-item .mn-icon  { font-size: 18px; line-height: 1; }
.mn-item .mn-label { font-size: 9px; letter-spacing: 0.3px; white-space: nowrap; }

/* Drawer mobile */
.mobile-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44,24,16,0.5);
  z-index: 60;
  backdrop-filter: blur(3px);
}
.mobile-drawer-overlay.open { display: block; }

.mobile-drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-2);
  border-radius: 16px 16px 0 0;
  border-top: 1px solid var(--border);
  z-index: 70;
  padding: 12px 16px 32px;
  transform: translateY(100%);
  transition: transform 0.25s var(--ease);
}
.mobile-drawer.open { transform: translateY(0); }

.mobile-drawer-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.mobile-drawer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.mobile-drawer-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--text-muted);
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  border: none;
}
.mobile-drawer-item:active,
.mobile-drawer-item.active {
  background: var(--accent-glow);
  color: var(--accent);
}
.mdi-icon { font-size: 22px; }
.mdi-label { font-size: 11px; font-weight: 500; }

/* Safe area iPhone */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-nav {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    height: calc(60px + env(safe-area-inset-bottom));
  }
  .mobile-drawer {
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }
  #page-content {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 600px) {
  input, select, textarea { font-size: 16px !important; }
  .form-label { font-size: 11px !important; }
  html, body { overscroll-behavior: none; }
}

/* Message bienvenue dans espace centré */
#page-content .espace-section-body textarea {
  text-align: left;
}

/* Message bienvenue centré */
#esp-presentation,
textarea[id^="esp-presentation"] {
  text-align: center;
}

/* ── SECTION ADMIN ESPACE — PLEINE LARGEUR ── */
#page-content .espace-section-body .admin-info-section {
  display: block !important;
  width: 100%;
}

#page-content .espace-section-body .admin-grid-3 {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr !important;
  gap: 12px !important;
  width: 100% !important;
  flex-direction: unset !important;
  align-items: unset !important;
}

#page-content .espace-section-body .admin-grid-3 > div {
  display: block !important;
  flex-direction: unset !important;
  align-items: unset !important;
  width: 100% !important;
}

/* Contrat & règlement pleine largeur */
#page-content .espace-section-body .admin-info-section > div {
  display: block !important;
  width: 100% !important;
}

#page-content .espace-section-body .admin-info-section .contrat-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr !important;
  gap: 12px !important;
  width: 100% !important;
}
