/* =========================
   THEME / TOKENS
========================= */
:root{
  --bgA: #eef2ff;
  --bgB: #f8fafc;
  --bgC: #f1f5f9;

  --text: #0f172a;
  --muted: rgba(15, 23, 42, .72);

  --card: #ffffff;
  --border: rgba(15, 23, 42, .10);

  --primary: #4f46e5;
  --primary2: #6366f1;

  --shadow: 0 20px 55px rgba(79, 70, 229, .12);
  --radius: 20px;

  --focus: 0 0 0 4px rgba(79,70,229,.14);
}

/* =========================
   BASE
========================= */
*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);

  /* Fond coloré global (marche sur toutes les pages) */
  background: linear-gradient(135deg, var(--bgA) 0%, var(--bgB) 45%, var(--bgC) 100%);
  padding: 24px;
}

/* Compat si certaines pages utilisent <body class="bg"> */
body.bg{}

/* conteneur */
.page{
  max-width: 1200px;
  margin: 0 auto;
}

/* =========================
   CARD
========================= */
.card{
  max-width: 1200px;
  margin: 0 auto;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid rgba(79,70,229,.10);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header{
  padding: 18px 20px;
  border-bottom: 1px solid rgba(15,23,42,.08);
  background: linear-gradient(180deg, rgba(79,70,229,.06), rgba(255,255,255,0));
}

.card-header h1{
  margin: 0 0 6px;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.card-header p{
  margin: 0;
  color: var(--muted);
}

.card-body{
  padding: 18px 20px 24px;
}

/* =========================
   STEPS (index)
========================= */
.steps{
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.step{
  font-weight: 900;
  font-size: .85rem;
  padding: .35rem .65rem;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.75);
  color: rgba(15,23,42,.75);
}

.step.active{
  background: rgba(79,70,229,.12);
  border-color: rgba(79,70,229,.25);
  color: rgba(15,23,42,.92);
}

/* =========================
   BUTTONS
========================= */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  cursor: pointer;
  text-decoration: none;

  border-radius: 14px;
  border: 1px solid var(--border);
  padding: .68rem 1rem;
  font-weight: 1000;

  color: var(--text);
  background: #fff;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
}

.btn-main{
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary2) 100%);
  color: #fff;
  border: 0;
}

.btn-main:hover{
  box-shadow: 0 14px 34px rgba(79,70,229,.28);
}

.btn-ghost{
  background: rgba(15,23,42,.06);
  border-color: rgba(15,23,42,.10);
}

.btn-ghost:hover{
  filter: brightness(0.98);
}

.btn-compact{
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
}

/* =========================
   FORMS (index)
========================= */
.panel{
  background: rgba(255,255,255,.70);
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 16px;
  padding: 16px;
}

.field{ margin-bottom: 12px; }

.field label{
  display: block;
  font-weight: 900;
  margin-bottom: 6px;
}

.req{ color: var(--primary); font-weight: 900; }

input, textarea, select{
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.12);
  padding: .72rem .85rem;
  font: inherit;
  outline: none;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus, textarea:focus, select:focus{
  border-color: rgba(79,70,229,.45);
  box-shadow: var(--focus);
}

textarea{ resize: vertical; }

.checkbox{
  display: flex;
  align-items: center;
  gap: 10px;
}
.checkbox input{
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
.checkbox label{ margin: 0; font-weight: 800; }

/* grids */
.grid-2{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.grid-2.tight{ gap: 10px; }

/* subpanels */
.subpanel{
  margin: 12px 0;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(79,70,229,.12);
  background: rgba(79,70,229,.06);
}
.subpanel-title{
  margin: 0 0 10px;
  font-size: 1rem;
}

.inline-error{
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(231, 76, 60, .10);
  border: 1px solid rgba(231, 76, 60, .25);
  font-weight: 900;
}

/* total */
.total{
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(79,70,229,.14);
  background: rgba(255,255,255,.82);
}
.total-line{
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.total-label{ font-weight: 900; }
.total-value{ font-weight: 1000; }
.total-note{ margin: 8px 0 0; color: var(--muted); }

.form-footer{
  margin-top: 14px;
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hint{ margin: 0; color: var(--muted); }

/* =========================
   RECAP TABLE
========================= */
.table-card{
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.70);
  overflow: hidden;
}

.table-row{
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15,23,42,.06);
  align-items: center;
}

.table-row:last-child{ border-bottom: 0; }

.table-row.highlight{
  background: rgba(79,70,229,.08);
}

.table-label{
  font-weight: 1000;
  color: rgba(15,23,42,.88);
}

.table-value{
  color: rgba(15,23,42,.95);
}

.total-display{
  font-size: 1.15rem;
  font-weight: 1000;
}

.table-footer.footer-row{
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
}

/* =========================
   ADMIN STATS
========================= */
.admin-stats{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-box{
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255,255,255,.85);
}

.stat-label{
  display: block;
  font-size: .85rem;
  opacity: .75;
  margin-bottom: 6px;
}

.stat-value{
  display: block;
  font-size: 1.15rem;
  font-weight: 1000;
}

/* =========================
   ADMIN CHART
========================= */
.admin-chart{ margin-bottom: 18px; }
.admin-chart h3{
  margin: 0 0 8px;
  font-size: 1rem;
}

/* =========================
   TABLE SCROLL HORIZONTAL (admin)
========================= */
.admin-table-wrapper{
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.85);
}

.admin-table{
  width: max-content;
  min-width: 1200px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td{
  white-space: nowrap;
  padding: .72rem .78rem;
  border-bottom: 1px solid rgba(15,23,42,.06);
  vertical-align: top;
  font-size: .92rem;
}

.admin-table thead th{
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid rgba(15,23,42,.08);
}

/* Remarques */
.cell-notes{
  max-width: 260px;
  white-space: normal;
  line-height: 1.25;
}

.cell-status{ min-width: 220px; }
.status-actions{
  margin-top: .45rem;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* =========================
   LIGNES STATUTS (ADMIN)
   ✅ Non payé = ORANGE / Payé = VERT
========================= */
.row-paid{
  background: linear-gradient(90deg, rgba(34,197,94,0.12), rgba(34,197,94,0.04));
  border-left: 6px solid #22c55e;
}

.row-pending{
  background: linear-gradient(90deg, rgba(249,115,22,0.16), rgba(249,115,22,0.05));
  border-left: 6px solid #f97316;
}

.row-reminded{
  background: linear-gradient(90deg, rgba(234,179,8,0.18), rgba(234,179,8,0.05));
  border-left: 6px solid #eab308;
}

.row-paid:hover,
.row-pending:hover,
.row-reminded:hover{
  filter: brightness(0.975);
}

/* =========================
   BADGES STATUTS (ADMIN)
========================= */
.status-badge{
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  font-weight: 900;
  font-size: .80rem;
  border: none;
}

.status-paid{
  background: #dcfce7;
  color: #166534;
}

.status-pending{
  background: #ffedd5;
  color: #9a3412;
}

.status-reminded{
  background: #fef9c3;
  color: #854d0e;
}

/* =========================
   BOUTONS ACTIONS (ADMIN)
========================= */
.btn-small{
  border: none;
  border-radius: 12px;
  padding: .48rem .82rem;
  font-size: .82rem;
  font-weight: 1000;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

/* Marquer payé */
.btn-pay{
  background: #22c55e;
  color: #fff;
}

.btn-pay:hover{
  background: #16a34a;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(34,197,94,.28);
}

/* Rappel */
.btn-remind{
  background: #f97316;
  color: #fff;
}

.btn-remind:hover{
  background: #ea580c;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(249,115,22,.28);
}

/* =========================
   HINT SCROLL
========================= */
.scroll-hint{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 6px 0 10px;
  font-size: .85rem;
  opacity: .92;
}

.scroll-hint .pill{
  padding:.2rem .6rem;
  border-radius:999px;
  border:1px dashed rgba(15,23,42,.25);
  font-weight:1000;
}

.scroll-hint .legend{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* =========================
   LOGOUT
========================= */
.admin-logout-form{ margin-top: 18px; }

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 900px){
  .admin-stats{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px){
  .admin-table{ min-width: 1050px; }
  .admin-table th, .admin-table td{ padding: .62rem .62rem; font-size: .88rem; }
}

@media (max-width: 620px){
  body{ padding: 14px; }
  .card-body{ padding: 14px 14px 20px; }
  .table-row{ grid-template-columns: 1fr; }
  .grid-2{ grid-template-columns: 1fr; }
}/* Habillage spécial 51e Carnaval */
.hero{position:relative;background:linear-gradient(135deg,rgba(79,70,229,.12),rgba(236,72,153,.08));}
.edition{display:inline-block;margin-bottom:10px;padding:6px 10px;border-radius:999px;background:#111827;color:#fff;font-size:.72rem;font-weight:1000;letter-spacing:.12em;}
.event-strip{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 16px;padding:13px 16px;border:1px solid rgba(79,70,229,.12);border-radius:16px;background:rgba(79,70,229,.05);font-weight:800;}
@media(max-width:700px){body{padding:12px}.grid-2{grid-template-columns:1fr}.form-footer{align-items:stretch;flex-direction:column}.btn{width:100%}}
