:root {
  --green: #1e8e3e;
  --green-bg: #e6f4ea;
  --red: #c5221f;
  --red-bg: #fce8e6;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --border: #e0e0e0;
  --bg: #f7f7f8;
  --accent: #2b5fd9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

header.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

header.topbar h1 {
  font-size: 18px;
  margin: 0;
}

header.topbar a, header.topbar button {
  font-size: 14px;
}

h1 { font-size: 22px; }
h2 { font-size: 18px; margin-top: 28px; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0 4px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
}

button, .btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

button.secondary, .btn.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
}

button.danger { background: var(--red); }

button:disabled { opacity: 0.5; cursor: not-allowed; }

.error {
  color: var(--red);
  font-size: 14px;
  margin-top: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}

th { background: #fafafa; font-size: 12px; text-transform: uppercase; color: var(--muted); }

.thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #ddd;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.paid { background: var(--green-bg); color: var(--green); }
.badge.unpaid { background: var(--red-bg); color: var(--red); }

.row-actions a, .row-actions button {
  font-size: 13px;
  padding: 6px 10px;
  margin-right: 4px;
}

/* ---- Fiche élève (écran plein) ---- */
.fiche {
  max-width: 420px;
  margin: 40px auto;
  text-align: center;
}

.fiche .photo {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  background: #ddd;
  margin: 0 auto 20px;
  border: 4px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.fiche .name {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 6px;
}

.fiche .activity {
  font-size: 17px;
  color: var(--muted);
  margin-bottom: 24px;
}

.status-banner {
  border-radius: 14px;
  padding: 22px;
  font-size: 22px;
  font-weight: 800;
}

.status-banner.paid { background: var(--green-bg); color: var(--green); }
.status-banner.unpaid { background: var(--red-bg); color: var(--red); }

/* ---- Cartes imprimables ---- */
.card-print {
  width: 340px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  background: #fff;
  page-break-inside: avoid;
  margin-bottom: 16px;
}

.card-print img.photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: #ddd;
  flex: none;
}

.card-print .info { flex: 1; }
.card-print .info .name { font-weight: 800; font-size: 15px; }
.card-print .info .activity { font-size: 13px; color: var(--muted); }
.card-print canvas { flex: none; }

@media print {
  header.topbar, .no-print { display: none !important; }
  body { background: #fff; }
  .cards-grid { display: flex; flex-wrap: wrap; gap: 14px; }
}

.cards-grid { display: flex; flex-wrap: wrap; gap: 14px; }

.hint { color: var(--muted); font-size: 13px; }
