/*
 * Portail parents (5.7.1) : présentation « application ». Page publique, dans le thème du site :
 * tout est sous .erp-portal. Menu latéral foncé sur ordinateur, barre d'onglets en bas sur mobile.
 * Une couleur par rubrique : accueil violet, planning vert, notes corail, activité rose, facturation bleu.
 */
.erp-portal {
  --erp-p-ink: #1A1F36;
  --erp-p-muted: #5B6476;
  --erp-p-subtle: #8792A2;
  --erp-p-line: #E9ECF2;
  --erp-p-bg: #F5F6FB;
  --erp-p-surface: #FFFFFF;
  --erp-p-night: #26215C;
  --erp-p-home: #534AB7;   --erp-p-home-soft: #EEEDFE;   --erp-p-home-ink: #3C3489;
  --erp-p-plan: #0F8F6A;   --erp-p-plan-soft: #E1F5EE;   --erp-p-plan-ink: #085041;
  --erp-p-notes: #D85A30;  --erp-p-notes-soft: #FAECE7;  --erp-p-notes-ink: #712B13;
  --erp-p-act: #C2447A;    --erp-p-act-soft: #FBEAF0;    --erp-p-act-ink: #72243E;
  --erp-p-bill: #2C6CC4;   --erp-p-bill-soft: #E6F1FB;   --erp-p-bill-ink: #0C447C;
  --erp-p-train: #E08A1E;  --erp-p-train-soft: #FDF0DC;  --erp-p-train-ink: #6B3D04;
  --erp-p-good: #2F8A3B; --erp-p-good-soft: #EAF3DE;
  --erp-p-mid: #B26B06;  --erp-p-mid-soft: #FAEEDA;
  --erp-p-low: #C0392B;  --erp-p-low-soft: #FCEBEB;
  --erp-p-radius: 18px;
  max-width: 1120px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--erp-p-ink);
  -webkit-font-smoothing: antialiased;
}
.erp-portal *, .erp-portal *::before, .erp-portal *::after { box-sizing: border-box; }
.erp-portal h2, .erp-portal h3 { margin: 0; font-family: inherit; color: inherit; letter-spacing: -.01em; }
.erp-portal h2 { font-size: 24px; font-weight: 700; line-height: 1.2; }
.erp-portal h3 { font-size: 16px; font-weight: 650; margin-bottom: 12px; color: var(--erp-p-ink); }
.erp-portal p { margin: 0 0 8px; }
.erp-portal a { color: inherit; }
.erp-portal button { font-family: inherit; }
.erp-portal [hidden] { display: none !important; }
.erp-p-ico { width: 20px; height: 20px; flex-shrink: 0; }
.erp-p-muted { color: var(--erp-p-muted); }
.erp-p-small { font-size: 13px; color: var(--erp-p-subtle); margin: 8px 2px 16px !important; }

/* ---------- Mise en page : menu + contenu ---------- */
.erp-p-app { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; background: var(--erp-p-bg); border-radius: 24px; padding: 16px; }
.erp-p-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; border-radius: 20px; background: var(--erp-p-night); color: #AFA9EC; }
.erp-p-brand { display: flex; align-items: center; gap: 10px; margin: 0 4px 14px; color: #fff; font-weight: 650; font-size: 15px; }
.erp-p-brand-avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--erp-p-home-soft); color: var(--erp-p-home-ink); font-size: 13px; font-weight: 700; }
.erp-p-tab, .erp-p-nav-logout { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; color: #AFA9EC; font-size: 14px; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; transition: background .15s, color .15s; }
.erp-p-tab:hover, .erp-p-nav-logout:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.erp-p-tab.is-active { background: var(--erp-p-home); color: #fff; }
.erp-p-tab-planning.is-active { background: var(--erp-p-plan); }
.erp-p-tab-notes.is-active { background: var(--erp-p-notes); }
.erp-p-tab-activite.is-active { background: var(--erp-p-act); }
.erp-p-tab-facturation.is-active { background: var(--erp-p-bill); }
.erp-p-nav-logout { margin-top: 16px; font-weight: 500; font-size: 13px; }
.erp-p-tab:focus-visible, .erp-p-btn:focus-visible, .erp-p-tile:focus-visible, .erp-p-round:focus-visible { outline: 3px solid rgba(83, 74, 183, .45); outline-offset: 2px; }
.erp-p-main { min-width: 0; }
.erp-p-panel { animation: erp-p-in .22s ease-out; }
@keyframes erp-p-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- En-tête coloré de chaque rubrique ---------- */
.erp-p-hero { position: relative; padding: 22px 22px 26px; border-radius: var(--erp-p-radius); color: #fff; margin-bottom: 16px; overflow: hidden; }
.erp-p-c-home .erp-p-hero { background: var(--erp-p-home); padding-bottom: 54px; }
.erp-p-c-planning .erp-p-hero { background: var(--erp-p-plan); }
.erp-p-c-notes .erp-p-hero { background: var(--erp-p-notes); }
.erp-p-c-activite .erp-p-hero { background: var(--erp-p-act); }
.erp-p-c-facturation .erp-p-hero { background: var(--erp-p-bill); }
.erp-p-hero::after { content: ""; position: absolute; right: -40px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, .08); pointer-events: none; }
.erp-p-hero h2 { color: #fff; }
.erp-p-hero-kicker { margin: 0 0 2px !important; font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .78); }
.erp-p-hero-row { display: flex; align-items: center; gap: 12px; }
.erp-p-avatar { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--erp-p-home-ink); font-weight: 700; font-size: 16px; flex-shrink: 0; }
.erp-p-hero-logout { display: none; margin-left: auto; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; }
.erp-p-hero-big { font-size: 40px !important; line-height: 1.05 !important; }
.erp-p-hero-big small { display: block; margin-top: 4px; font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, .8); letter-spacing: 0; }

/* ---------- Cartes ---------- */
.erp-p-card { background: var(--erp-p-surface); border-radius: var(--erp-p-radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(26, 31, 54, .05), 0 4px 16px rgba(26, 31, 54, .04); }
.erp-p-label { display: block; font-size: 12px; font-weight: 600; color: var(--erp-p-muted); text-transform: uppercase; letter-spacing: .04em; }

/* Prochain cours, qui chevauche l'en-tête de l'accueil */
.erp-p-next { position: relative; z-index: 1; margin: -44px 14px 16px; padding: 14px 16px; border-radius: 16px; background: var(--erp-p-surface); box-shadow: 0 6px 24px rgba(38, 33, 92, .14); }
.erp-p-next-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.erp-p-next-what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.erp-p-next-what strong { font-size: 16px; }
.erp-p-next-what span { font-size: 13px; color: var(--erp-p-muted); }

/* Case date (jour + numéro) et pastilles, selon le type de séance */
.erp-p-datebox { flex-shrink: 0; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 50px; height: 54px; border-radius: 14px; line-height: 1.1; }
.erp-p-datebox small { font-size: 12px; font-weight: 600; }
.erp-p-datebox strong { font-size: 20px; font-weight: 750; }
.erp-p-k-cours.erp-p-datebox, .erp-p-k-cours.erp-p-chip { background: var(--erp-p-plan-soft); color: var(--erp-p-plan-ink); }
.erp-p-k-entrainement.erp-p-datebox, .erp-p-k-entrainement.erp-p-chip { background: var(--erp-p-train-soft); color: var(--erp-p-train-ink); }
.erp-p-chip { flex-shrink: 0; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.erp-p-chip-notes { background: var(--erp-p-notes-soft); color: var(--erp-p-notes-ink); }
.erp-p-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--erp-p-plan); }
.erp-p-dot.erp-p-k-entrainement, b.erp-p-k-entrainement { background: var(--erp-p-train); }

/* Tuiles colorées */
.erp-p-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.erp-p-tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.erp-p-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 14px; border: 0; border-radius: 16px; text-align: left; cursor: pointer; transition: transform .12s ease; }
div.erp-p-tile { cursor: default; }
button.erp-p-tile:hover { transform: translateY(-2px); }
button.erp-p-tile:active { transform: scale(.98); }
.erp-p-tile .erp-p-ico { width: 22px; height: 22px; margin-bottom: 6px; }
.erp-p-tile strong { font-size: 20px; font-weight: 750; line-height: 1.2; }
.erp-p-tile strong small { font-size: 13px; font-weight: 600; opacity: .75; }
.erp-p-tile span { font-size: 12px; font-weight: 500; }
.erp-p-t-planning { background: var(--erp-p-plan-soft); color: var(--erp-p-plan-ink); }
.erp-p-t-planning .erp-p-ico { color: var(--erp-p-plan); }
.erp-p-t-notes { background: var(--erp-p-notes-soft); color: var(--erp-p-notes-ink); }
.erp-p-t-notes .erp-p-ico { color: var(--erp-p-notes); }
.erp-p-t-activite { background: var(--erp-p-act-soft); color: var(--erp-p-act-ink); }
.erp-p-t-activite .erp-p-ico { color: var(--erp-p-act); }
.erp-p-t-facturation { background: var(--erp-p-bill-soft); color: var(--erp-p-bill-ink); }
.erp-p-t-facturation .erp-p-ico { color: var(--erp-p-bill); }

/* Listes */
.erp-p-list { margin: 0; padding: 0; list-style: none; }
.erp-p-list li { display: flex; align-items: center; gap: 12px; margin: 0; padding: 12px 0; border-top: 1px solid var(--erp-p-line); }
.erp-p-list li:first-child { border-top: 0; padding-top: 2px; }
.erp-p-what { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.erp-p-what strong { font-weight: 600; }
.erp-p-what span { font-size: 13px; color: var(--erp-p-muted); }
.erp-p-what a { text-decoration: none; }
.erp-p-meta { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--erp-p-muted); font-variant-numeric: tabular-nums; }
.erp-p-rank { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 10px; background: var(--erp-p-act-soft); color: var(--erp-p-act-ink); font-weight: 700; font-size: 13px; flex-shrink: 0; }

/* ---------- Planning ---------- */
.erp-p-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 16px; }
.erp-p-weekday { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; border-radius: 14px; background: rgba(255, 255, 255, .12); line-height: 1.1; }
.erp-p-weekday small { font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, .8); }
.erp-p-weekday strong { font-size: 17px; font-weight: 700; }
.erp-p-weekday i { display: flex; gap: 3px; height: 6px; }
.erp-p-weekday b { display: block; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.erp-p-weekday b.erp-p-k-entrainement { background: #FFD08A; }
.erp-p-weekday.is-today { background: #fff; color: var(--erp-p-plan-ink); }
.erp-p-weekday.is-today small { color: var(--erp-p-plan); }
.erp-p-weekday.is-today b { background: var(--erp-p-plan); }
.erp-p-sessions { margin: 0 0 16px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.erp-p-session { display: flex; align-items: center; gap: 12px; margin: 0; padding: 12px 14px; border-radius: 16px; background: var(--erp-p-surface); border-left: 5px solid var(--erp-p-plan); box-shadow: 0 1px 2px rgba(26, 31, 54, .05); }
.erp-p-session.erp-p-k-entrainement { border-left-color: var(--erp-p-train); }
.erp-p-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.erp-p-cal-head h3 { margin: 0; text-transform: capitalize; }
.erp-p-round { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--erp-p-plan-soft); color: var(--erp-p-plan-ink); font-size: 20px; cursor: pointer; }
.erp-p-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.erp-p-cal-dow { padding: 4px 6px; font-size: 11px; font-weight: 700; color: var(--erp-p-subtle); text-transform: uppercase; }
.erp-p-cal-day { min-height: 78px; padding: 6px; border-radius: 12px; background: var(--erp-p-bg); font-size: 12px; }
.erp-p-cal-day.is-out { background: transparent; color: #C3C8D2; }
.erp-p-cal-day.is-today { background: var(--erp-p-plan-soft); }
.erp-p-cal-day.is-today .erp-p-cal-num { background: var(--erp-p-plan); color: #fff; }
.erp-p-cal-num { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; border-radius: 99px; font-weight: 700; }
.erp-p-cal-ev { display: block; margin-top: 4px; padding: 3px 6px; border-radius: 8px; background: var(--erp-p-plan); color: #fff; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erp-p-cal-ev.erp-p-ev-entrainement { background: var(--erp-p-train); }
.erp-p-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 12px 0 0 !important; font-size: 13px; color: var(--erp-p-muted); }

/* ---------- Notes ---------- */
.erp-p-chart { position: relative; height: 150px; margin-top: 12px; }
.erp-p-notes { margin: 0 0 16px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.erp-p-note { margin: 0; padding: 16px; border-radius: var(--erp-p-radius); background: var(--erp-p-surface); box-shadow: 0 1px 2px rgba(26, 31, 54, .05), 0 4px 16px rgba(26, 31, 54, .04); }
.erp-p-note-head { display: flex; align-items: center; gap: 10px; }
.erp-p-note-head .erp-p-meta { flex: 1; }
.erp-p-grade { flex-shrink: 0; padding: 6px 12px; border-radius: 12px; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.erp-p-grade-good { background: var(--erp-p-good-soft); color: var(--erp-p-good); }
.erp-p-grade-mid { background: var(--erp-p-mid-soft); color: var(--erp-p-mid); }
.erp-p-grade-low { background: var(--erp-p-low-soft); color: var(--erp-p-low); }
.erp-p-note-sujet { margin: 10px 0 0 !important; font-weight: 600; }
.erp-p-comment { margin: 10px 0 0 !important; padding: 12px 14px; border-radius: 14px; background: var(--erp-p-notes-soft); color: var(--erp-p-notes-ink); font-size: 14px; }
.erp-p-comment::before { content: "« "; }
.erp-p-comment::after { content: " »"; }
.erp-p-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0 !important; }
.erp-p-files a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--erp-p-notes-soft); color: var(--erp-p-notes); font-size: 14px; font-weight: 650; text-decoration: none; }
.erp-p-files a .erp-p-ico { width: 18px; height: 18px; }

/* ---------- Facturation ---------- */
.erp-p-subcard { position: relative; margin-bottom: 14px; padding: 20px; border-radius: var(--erp-p-radius); background: var(--erp-p-night); color: #fff; overflow: hidden; }
.erp-p-subcard::after { content: ""; position: absolute; right: -50px; bottom: -70px; width: 220px; height: 220px; border-radius: 50%; background: rgba(44, 108, 196, .45); }
.erp-p-subcard-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #AFA9EC; }
.erp-p-subcard-level { display: block; margin: 4px 0 16px; font-size: 20px; font-weight: 700; }
.erp-p-subcard-row { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.erp-p-subcard-row span { display: block; font-size: 12px; color: #CECBF6; }
.erp-p-subcard-row strong { font-size: 15px; }
.erp-p-tag { padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 650; background: var(--erp-p-bg); color: var(--erp-p-muted); }
.erp-p-tag-ok { background: var(--erp-p-good-soft); color: var(--erp-p-good); }
.erp-p-tag-warn { background: var(--erp-p-mid-soft); color: var(--erp-p-mid); }
.erp-p-payments .erp-p-meta strong { color: var(--erp-p-ink); }

/* ---------- Boutons et alertes ---------- */
.erp-p-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border: 0; border-radius: 14px; background: var(--erp-p-surface); color: var(--erp-p-ink); font-size: 15px; font-weight: 650; text-decoration: none; cursor: pointer; transition: transform .12s ease, filter .12s; }
.erp-p-btn:active { transform: scale(.98); }
.erp-p-btn-primary { width: 100%; background: var(--erp-p-bill); color: #fff !important; box-shadow: 0 6px 18px rgba(44, 108, 196, .3); }
.erp-p-btn-primary:hover { filter: brightness(1.07); }
.erp-p-btn-small { min-height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13px; background: var(--erp-p-bill-soft); color: var(--erp-p-bill-ink); }
.erp-p-btn-small .erp-p-ico { width: 16px; height: 16px; }
.erp-p-btn[disabled] { opacity: .6; cursor: default; }
.erp-p-alert { margin: 12px 0; padding: 12px 14px; border-radius: 14px; background: var(--erp-p-bg); font-size: 14px; }
.erp-p-alert-ok { background: var(--erp-p-good-soft); color: var(--erp-p-good); }
.erp-p-alert-warn { background: var(--erp-p-mid-soft); color: var(--erp-p-mid); }
.erp-p-alert-info { background: var(--erp-p-home-soft); color: var(--erp-p-home-ink); margin-top: 0; }

/* ---------- Connexion ---------- */
.erp-portal .erp-p-login { max-width: 440px; margin: 24px auto; padding: 0; overflow: hidden; border-radius: 24px; }
.erp-p-login-hero { padding: 28px 24px 24px; background: var(--erp-p-home); color: #fff; }
.erp-p-login-hero h2 { color: #fff; margin: 12px 0 4px; }
.erp-p-login-hero p { color: rgba(255, 255, 255, .82); margin: 0; }
.erp-p-login-body { padding: 20px 24px 24px; }
.erp-p-login-form { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.erp-p-login-form label { font-size: 14px; font-weight: 650; }
.erp-p-login-form input { width: 100%; min-height: 50px; padding: 0 14px; border: 1.5px solid var(--erp-p-line); border-radius: 14px; font: inherit; font-size: 16px; color: var(--erp-p-ink); background: #fff; }
.erp-p-login-form input:focus { outline: none; border-color: var(--erp-p-home); box-shadow: 0 0 0 4px var(--erp-p-home-soft); }
.erp-p-open-form { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.erp-portal .erp-p-open-text { margin: 0; font-size: 16px; line-height: 1.5; color: var(--erp-p-ink); }
.erp-p-open-form .erp-p-btn-primary { width: 100%; background: var(--erp-p-home); box-shadow: 0 6px 18px rgba(83, 74, 183, .3); }
.erp-p-login-form .erp-p-btn-primary { background: var(--erp-p-home); box-shadow: 0 6px 18px rgba(83, 74, 183, .3); margin-top: 6px; }
.erp-p-center { text-align: center; }

/* ---------- Tablette ---------- */
@media (max-width: 960px) {
  .erp-p-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Mobile : barre d'onglets en bas, contenu pleine largeur ---------- */
@media (max-width: 720px) {
  .erp-p-app { display: block; padding: 0; background: transparent; border-radius: 0; }
  .erp-p-main { padding-bottom: 8px; }
  .erp-p-nav { position: sticky; top: auto; bottom: 8px; z-index: 20; flex-direction: row; justify-content: space-around; gap: 0; margin: 12px 0 0; padding: 6px; border-radius: 22px; box-shadow: 0 10px 30px rgba(38, 33, 92, .3); order: 2; }
  .erp-p-app { display: flex; flex-direction: column; align-items: stretch; }
  .erp-p-brand, .erp-p-nav-logout { display: none; }
  .erp-p-tab { flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 2px; min-height: 54px; padding: 4px 0; border-radius: 16px; font-size: 11px; text-align: center; }
  .erp-p-tab .erp-p-ico { width: 22px; height: 22px; }
  .erp-p-hero { border-radius: 22px; padding: 18px 18px 22px; }
  .erp-p-c-home .erp-p-hero { padding-bottom: 50px; }
  .erp-p-hero-logout { display: inline-flex; }
  .erp-p-hero-big { font-size: 34px !important; }
  .erp-p-next { margin-left: 10px; margin-right: 10px; }
  .erp-p-tiles, .erp-p-tiles-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .erp-p-tiles-3 .erp-p-tile:last-child { grid-column: 1 / -1; }
  .erp-p-card { padding: 16px; border-radius: 18px; }
  .erp-p-cal-card { display: none; }
  .erp-p-week { gap: 4px; }
  .erp-p-subcard-row { grid-template-columns: minmax(0, 1fr); }
  .erp-p-payments li { flex-wrap: wrap; }
  .erp-p-payments .erp-p-btn-small { width: 100%; }
  .erp-p-session { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .erp-p-panel { animation: none; }
  .erp-p-tile, .erp-p-btn { transition: none; }
}
