/* Espace famille et admin (complète style.css) */

.app { background: #f6f5f1; }
.app-main { padding: 32px 0 56px; }
.app-h1 { font-size: clamp(1.5rem, 3.5vw, 2rem); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.app-sub { color: var(--muted); margin-top: -.4em; }
.app nav { gap: 16px; flex-wrap: wrap; }
.app nav a:not(.btn) { display: inline; }
.mt { margin-top: 18px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.err { color: var(--red); }

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.panel h2 { font-size: 1.2rem; margin-bottom: .7em; }
.panel h3 { font-size: 1rem; color: var(--muted); }
.panel-hl { border: 2px solid var(--blue); }
.panel-warn { border: 2px solid #f59e0b; background: #fffbeb; }
.narrow-panel { max-width: 460px; margin: 40px auto; }
details.panel > summary { cursor: pointer; }
details.panel[open] > summary { margin-bottom: 14px; }

.flash { padding: 12px 16px; border-radius: 10px; font-weight: 600; margin-bottom: 18px; }
.flash-ok { background: #dcfce7; color: #14532d; }
.flash-err { background: #fee2e2; color: #7f1d1d; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.actions form { margin: 0; }
.btn-danger { background: var(--red) !important; border-color: var(--red) !important; color: #fff !important; }
.mini-form { margin-top: 12px; padding: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 10px; }
.form-flat { border: 0; padding: 0; background: none; }
.form-flat .btn { justify-self: start; }
.form-flat .btn-full { justify-self: stretch; }
.f3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
.check input { width: auto; margin-top: 5px; }
.hint { margin-top: -6px; }
.inline { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.inline input, .inline select { width: auto; padding: 6px 8px; }
fieldset.optionnel { background: var(--bg); }
.recap { background: var(--blue-l); border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.recap span { font-weight: 400; color: #3b4252; }
.citation { border-left: 3px solid var(--line); padding-left: 12px; color: #3b4252; }
.regles { background: var(--bg); border-radius: 10px; padding: 14px 16px; }
.regles ul { margin: 0 0 10px; padding-left: 1.2em; }
.warn { color: #92400e; font-weight: 600; margin: 0; }
.ok-txt { color: var(--green); font-weight: 600; margin: 0; }

/* Cours (espace famille) */
.cours { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.cours:first-of-type { border-top: 0; }
.cours-date { background: var(--blue-l); color: var(--blue-d); border-radius: 12px; text-align: center; padding: 8px 0; display: grid; line-height: 1.15; height: fit-content; }
.cours-j, .cours-m { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.cours-n { font-size: 1.5rem; font-weight: 800; }
.cours-info p { margin: 0 0 4px; }
.cours-t { font-weight: 700; }
.cours-l { color: var(--muted); }
.cours-prix { font-size: .9rem; }
.cours-annule { opacity: .55; }
.cours-annule .cours-t { text-decoration: line-through; }

.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--blue-l); color: var(--blue-d); margin: 0; vertical-align: middle; }
.tag-grey, .tag-archivee { background: #eceae4; color: var(--muted); }
.tag-demande { background: #fef3c7; color: #92400e; }
.tag-a_inscrire { background: #e0e7ff; color: #3730a3; }
.tag-inscrite { background: #dcfce7; color: #14532d; }
.pastille { background: var(--red); color: #fff; border-radius: 99px; font-size: .72rem; padding: 1px 7px; font-weight: 700; }

.solde { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.solde div { background: var(--bg); border-radius: 10px; padding: 10px 12px; display: grid; }
.solde span { font-size: .82rem; color: var(--muted); }
.solde strong { font-size: 1.2rem; }
.solde-du { background: #fef3c7 !important; }
.solde-ok { background: #dcfce7 !important; }
.histo summary { cursor: pointer; color: var(--blue); }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .82rem; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table .num { text-align: right; white-space: nowrap; }
.table tr.paye td { color: var(--green); }
.lien-suppr { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.1rem; }

/* Admin */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; text-decoration: none; color: var(--ink); }
.kpi strong { font-size: 1.6rem; }
.kpi span { color: var(--muted); font-size: .88rem; }
.seance-ligne { display: grid; grid-template-columns: 190px 1fr 1fr 60px; gap: 10px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); align-items: center; }
.seance-ligne:hover { background: var(--blue-l); }
.sl-h { font-weight: 600; }
.sl-l { color: var(--muted); font-size: .9rem; }
.sl-s { text-align: right; font-size: .85rem; color: var(--muted); }
.sl-faite .sl-s { color: var(--green); font-weight: 700; }
.sl-annulee { opacity: .5; }
.sl-annulee .sl-h { text-decoration: line-through; }
.barre { text-decoration: line-through; color: var(--muted); }
.row-action { display: flex; align-items: center; gap: 10px; }
.row-action .seance-ligne { flex: 1; }
.row-action form { margin: 0; }
.demande { border-top: 1px solid var(--line); padding: 14px 0; }
.demande:first-of-type { border-top: 0; }
.demande-h { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.demande p { margin: 0 0 8px; }
.suggestion { background: #fef9c3; border-radius: 8px; padding: 8px 12px; }
.filtres { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; }
.filtres a { text-decoration: none; padding: 4px 10px; border-radius: 99px; }
.filtres a.on { background: var(--blue); color: #fff; }
.grid-fiche { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }
.lien-perso { display: flex; gap: 8px; align-items: center; }
.lien-perso input { font-size: .85rem; }
.serie { padding: 8px 0; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.serie-off { opacity: .5; }
.eleve summary { cursor: pointer; padding: 6px 0; }
.choix-eleves { display: grid; gap: 6px; max-height: 320px; overflow: auto; }
.jour { padding: 6px 0 10px; border-top: 1px solid var(--line); }
.jour:first-child { border-top: 0; }
.jour h3 { text-transform: capitalize; margin: 6px 0; }
.jour-auj h3 { color: var(--blue); }

@media (max-width: 860px) {
  .grid-fiche { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .seance-ligne { grid-template-columns: 1fr; gap: 2px; }
  .sl-s { text-align: left; }
  .f3 { grid-template-columns: 1fr 1fr; }
  .app nav a:not(.btn) { display: inline; font-size: .9rem; }
}
@media (max-width: 520px) {
  .panel { padding: 18px 16px; }
  .solde { grid-template-columns: 1fr; }
  .f3 { grid-template-columns: 1fr; }
  .row-action { flex-direction: column; align-items: stretch; }
  .app .top-in { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
}
