:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e2e6ea;
  --primary: #1e2749;
  --primary-d: #141b36;
  --accent: #e8c8b0;
  --ok: #16a34a;
  --err: #dc2626;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--primary); color: #fff;
  padding: .6rem 1.5rem; position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.05rem; }
.brand img { height: 34px; width: 34px; border-radius: 50%; }
.topbar nav { display: flex; gap: 1.25rem; align-items: center; }
.topbar nav a { color: #fff; }
.topbar nav a.muted { color: #b9c0d8; }

.container { width: 100%; max-width: 980px; margin: 1.5rem auto; padding: 0 1.5rem; flex: 1; }
h1 { font-size: 1.45rem; margin: 0 0 1rem; color: var(--primary); }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; color: var(--primary); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.req { color: var(--err); }

.flash { padding: .6rem .9rem; border-radius: var(--radius); margin-bottom: 1rem; font-weight: 500; }
.flash.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.btn {
  display: inline-block; padding: .5rem .9rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: #fff; color: var(--text);
  cursor: pointer; font-size: .95rem; font-family: inherit;
}
.btn:hover { text-decoration: none; background: #f9fafb; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-lg { padding: .7rem 1.6rem; font-size: 1.05rem; }
.btn-mini { padding: .2rem .55rem; font-size: .85rem; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem;
}
.login-card { max-width: 420px; margin: 4rem auto; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .92rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: .55rem .65rem; border: 1px solid var(--border);
  border-radius: 8px; font: inherit; background: #fff;
}
.field textarea { resize: vertical; }

.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grille-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 1rem; }
.span-2 { grid-column: span 2; }
@media (max-width: 640px) {
  .grille-2, .grille-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
}

.type-choix { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .type-choix { grid-template-columns: 1fr; } }
.radio-card {
  display: flex; gap: .6rem; align-items: flex-start;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .8rem; cursor: pointer;
}
.radio-card:has(input:checked) { border-color: var(--primary); background: #f0f2f8; }
.radio-card small { color: var(--muted); }

.tbl-reglements { width: 100%; border-collapse: collapse; margin-bottom: .75rem; }
.tbl-reglements th { text-align: left; font-size: .82rem; color: var(--muted); padding: .25rem .35rem; }
.tbl-reglements td { padding: .25rem .35rem; }
.tbl-reglements input, .tbl-reglements select {
  width: 100%; padding: .45rem .5rem; border: 1px solid var(--border);
  border-radius: 8px; font: inherit;
}

.tbl-liste { width: 100%; border-collapse: collapse; }
.tbl-liste th {
  text-align: left; font-size: .8rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .03em;
  padding: .4rem .5rem; border-bottom: 2px solid var(--border);
}
.tbl-liste td { padding: .55rem .5rem; border-bottom: 1px solid var(--border); }
.actions-ligne { white-space: nowrap; display: flex; gap: .35rem; }

.barre-recherche { display: flex; gap: .6rem; margin-bottom: 1.25rem; }
.barre-recherche input {
  flex: 1; padding: .55rem .65rem; border: 1px solid var(--border);
  border-radius: var(--radius); font: inherit;
}

.actions { margin: 1.5rem 0 3rem; }

.pied {
  text-align: center; color: var(--muted); font-size: .78rem;
  padding: 1rem; border-top: 1px solid var(--border);
}
