/* =============================================================
   Klat — espace salle (espace/*). S'ajoute à site.css.
   ============================================================= */

.k-app { min-height: 100vh; display: flex; flex-wrap: wrap; }

/* Les contrôles sont un cran plus compacts que sur les pages publiques. */
.k-app .k-btn { height: 44px; padding: 0 18px; font-size: 14.5px; }
.k-app .k-btn--sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.k-app .k-field { height: 44px; padding: 0 13px; border-radius: 10px; font-size: 14.5px; }
.k-app .k-seg button { height: 32px; padding: 0 14px; font-size: 13.5px; }

/* ── Barre latérale ─────────────────────────────────────────── */

.k-side { flex: 1 1 232px; min-width: 0; background: var(--bg-soft); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 22px; }
.k-side-brand { display: flex; align-items: baseline; gap: 8px; padding: 0 8px; }
.k-side-brand .k-logo { font-size: 24px; }
.k-side-brand > span { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.k-org { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: #FFFFFF; border: 1px solid var(--line); }
.k-org-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.k-org strong { display: block; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-org small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.k-org > span:last-child { min-width: 0; }

.k-side-nav { display: flex; flex-direction: column; gap: 2px; }
.k-side-nav a { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px; border-radius: 10px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.k-side-nav a:hover { background: rgba(17, 17, 17, .05); color: var(--ink); }
.k-side-nav a[aria-current="page"] { background: #FFFFFF; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(17, 17, 17, .08), inset 0 0 0 1px var(--line); }
.k-side-nav a[aria-disabled="true"]:hover { background: none; color: var(--ink-2); }
/* Pages qui demandent une salle, tant qu'il n'y en a aucune (espace.js). */
a[data-needs-gym][aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.k-btn--secondary[aria-disabled="true"]:hover { background: var(--fill); }

.k-side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid var(--line); }
.k-side-foot .k-avatar { width: 32px; height: 32px; }
.k-side-foot > span:nth-child(2) { flex: 1; min-width: 0; }
.k-side-foot strong { display: block; font-weight: 600; font-size: 13.5px; }
.k-side-foot small { display: block; font-size: 12px; color: var(--ink-3); }
.k-side-foot a { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--ink-3); }
.k-side-foot a:hover { background: rgba(17, 17, 17, .05); color: var(--ink); }

/* ── Contenu ────────────────────────────────────────────────── */

.k-main { flex: 999 1 640px; min-width: 0; padding: 36px 44px 64px; display: flex; flex-direction: column; gap: 24px; }
.k-main--savebar { padding-bottom: 0; }

/* La barre latérale reste à l'écran pendant le défilement. Sans ça, elle
   s'étire sur toute la page et, sur une page longue (Salles), le compte et
   la déconnexion, poussés en bas par margin-top: auto, finissent tout en
   bas du document. Seulement quand elle est à côté du contenu : sous
   872 px de conteneur (232 + 640), elle passe au-dessus. */
@media (min-width: 900px) {
  .k-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}

@media (max-width: 760px) {
  .k-side { padding: 16px; border-right: none; border-bottom: 1px solid var(--line); gap: 14px; }
  .k-side-nav { flex-direction: row; overflow-x: auto; margin-inline: -4px; padding: 2px 4px; }
  .k-side-foot { display: none; }
  .k-main { padding: 24px 16px 48px; }
  .k-main--savebar { padding-bottom: 0; }
}

.k-page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.k-page-head > div { display: flex; flex-direction: column; gap: 6px; }
.k-page-head small { font-size: 13.5px; font-weight: 600; color: var(--ink-3); }
.k-page-title { margin: 0; font-weight: 700; font-size: 32px; letter-spacing: -0.025em; line-height: 1.1; overflow-wrap: anywhere; }
.k-page-intro { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-3); max-width: 560px; }
.k-section-title { margin: 0; font-weight: 700; font-size: 20px; letter-spacing: -0.015em; }
.k-kicker { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink-3); }

.k-panel { border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.k-panel h2 { margin: 0 0 4px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.k-panel h2 + p { margin: 0; font-size: 13.5px; color: var(--ink-3); }
.k-panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; margin-top: 18px; }

.k-toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--ok-bg); color: var(--ok-ink); font-size: 14px; font-weight: 600; }

.k-link-btn { background: none; border: none; padding: 0 6px; height: 32px; border-radius: 8px; font-family: var(--font); font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.k-link-btn:hover { background: var(--fill); color: var(--ink); }
.k-link-btn--danger { padding: 0; height: auto; color: var(--danger); text-decoration: underline; text-underline-offset: 3px; }
.k-link-btn--danger:hover { background: none; color: var(--danger); }
.k-underline { font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* ── Accueil ────────────────────────────────────────────────── */

.k-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.k-kpi { padding: 18px; border-radius: 14px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.k-kpi span { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.k-kpi strong { font-weight: 700; font-size: 30px; letter-spacing: -0.03em; line-height: 1; }
.k-kpi small { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.k-kpi small.is-up { color: var(--ok-ink); }

.k-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.k-section-head a { font-size: 14px; font-weight: 600; }

.k-gyms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: stretch; }
.k-gym { border: 1px solid var(--line); border-radius: 18px; background: #FFFFFF; display: flex; flex-direction: column; overflow: hidden; }
.k-gym-head { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; }
.k-gym-head .k-avatar { width: 42px; height: 42px; font-size: 16px; }
.k-gym-head > span:nth-child(2) { flex: 1; min-width: 0; }
.k-gym-head strong { display: block; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.k-gym-status { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.k-gym-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 18px; border-block: 1px solid var(--line); }
.k-gym-stats > div { padding: 14px 0; display: flex; flex-direction: column; gap: 4px; }
.k-gym-stats > div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.k-gym-stats strong { font-weight: 700; font-size: 22px; letter-spacing: -0.02em; line-height: 1; }
.k-gym-stats span { font-size: 12px; color: var(--ink-3); }
.k-gym-chart { padding: 16px 18px 4px; display: flex; flex-direction: column; gap: 8px; }
.k-gym-chart > span { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.k-days { display: flex; align-items: flex-end; gap: 6px; height: 56px; }
.k-days > span { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; height: 100%; font-size: 10.5px; font-weight: 600; color: var(--ink-3); }
.k-days i { display: block; width: 100%; height: var(--h); min-height: 3px; border-radius: 4px; background: var(--ink); }
.k-days > span:last-child i { background: var(--accent); }
.k-gym-release { padding: 14px 18px 16px; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; }
.k-last-release { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: var(--bg-soft); }
.k-last-release .k-wall { width: 46px; height: 46px; border-radius: 9px; flex-shrink: 0; }
.k-last-release .k-hold { --b: 1.5px; }
.k-last-release-text { flex: 1; min-width: 0; }
.k-last-release small { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.k-last-release strong { display: block; font-weight: 700; font-size: 14px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-last-release-text em { display: block; font-style: normal; font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.k-empty { padding: 14px; border-radius: 12px; border: 1.5px dashed var(--line-2); display: flex; flex-direction: column; gap: 4px; }
.k-empty strong { font-weight: 700; font-size: 14px; }
.k-empty span { font-size: 13px; line-height: 1.45; color: var(--ink-3); }
.k-gym-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); }
.k-gym-foot > span { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.k-gym-foot .k-avatars .k-avatar { font-size: 10px; }
.k-gym-foot .k-avatars .k-avatar + .k-avatar { margin-left: -7px; }
.k-gym-foot a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 8px; font-size: 13.5px; font-weight: 600; }
.k-gym-foot a:hover { color: var(--ink); background: var(--fill); }
.k-add-gym { min-height: 220px; border: 1.5px dashed var(--line-2); border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--ink-2); text-align: center; padding: 24px; }
.k-add-gym:hover { background: var(--bg-soft); color: var(--ink); }
.k-add-gym > span:first-child { width: 44px; height: 44px; border-radius: 50%; background: var(--fill); display: flex; align-items: center; justify-content: center; }
.k-add-gym strong { font-weight: 700; font-size: 15px; }
.k-add-gym small { font-size: 13px; color: var(--ink-3); max-width: 220px; line-height: 1.45; }

/* ── Profil de la salle ─────────────────────────────────────── */

.k-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.k-pills button { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 6px; border-radius: 99px; border: none; cursor: pointer; font-family: var(--font); font-weight: 600; font-size: 14px; background: var(--fill); color: var(--ink); }
.k-pills button[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; }
.k-pills .k-avatar { width: 26px; height: 26px; font-size: 11.5px; }

.k-hours { display: flex; flex-direction: column; margin-top: 10px; }
.k-hour { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); min-height: 57px; }
.k-hour:last-child { border-bottom: none; }
.k-hour-day { width: 74px; font-weight: 600; font-size: 14px; }
.k-hour-times { display: flex; align-items: center; gap: 8px; flex: 1 1 230px; color: var(--ink-3); }
.k-app .k-hour-times .k-field { height: 38px; flex: 1 1 0; min-width: 0; max-width: 120px; }
.k-hour-closed { flex: 1; font-size: 14px; color: var(--ink-3); }

/* Cotation : cotations françaises, ou couleurs sur une plage de cotations */
.k-pills--text button { padding: 0 16px; }
.k-grading-kinds { margin-top: 16px; }
.k-grading-colors { margin-top: 18px; }
.k-grading-colors[hidden] { display: none; }
.k-grading-hint { margin: 0 0 6px; font-size: 13px; line-height: 1.45; color: var(--ink-3); max-width: 640px; }
.k-grading-list { margin: 0 0 14px; padding: 0; list-style: none; display: flex; flex-direction: column; }
.k-grading-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
/* La pastille ouvre le nuancier du navigateur, posé dessus et invisible. */
.k-grading-swatch { position: relative; width: 34px; height: 34px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); flex-shrink: 0; }
.k-grading-swatch.is-empty { box-shadow: none; border: 1.5px dashed var(--line-2); }
.k-grading-swatch:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.k-grading-swatch input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: none; opacity: 0; cursor: pointer; }
.k-grading-row .k-select, .k-app .k-grading-row .k-field { height: 38px; }
.k-app .k-grading-row [data-k="label"] { flex: 1 1 130px; width: auto; min-width: 0; max-width: 200px; }
.k-app .k-grading-row [data-k="color"] { width: 104px; text-transform: uppercase; }
.k-grading-range { display: flex; align-items: center; gap: 8px; flex: 1 1 220px; color: var(--ink-3); }
.k-grading-range .k-select { flex: 0 1 92px; min-width: 0; }
.k-grading-row .k-link-btn { margin-left: auto; }
.k-grading-status { margin: 10px 0 0; font-size: 13px; color: var(--ink-3); }
.k-grading-status:empty { display: none; }
.k-grading-status.is-error { color: var(--danger); }

.k-switch { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 99px; background: var(--line-2); position: relative; cursor: pointer; margin: 0; flex-shrink: 0; transition: background .15s ease; }
.k-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s ease; }
.k-switch:checked { background: var(--ink); }
.k-switch:checked::after { transform: translateX(16px); }

/* Logo et bannière : aperçu de l'entête de la salle dans l'app. */
.k-identity { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 22px 28px; margin-top: 18px; align-items: start; }
@media (max-width: 900px) { .k-identity { grid-template-columns: minmax(0, 1fr); } .k-identity-preview { max-width: 340px; } }
.k-identity-preview { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #FFFFFF; }
/* 2:1, comme la bannière enregistrée et la couverture de l'app. */
.k-identity-banner { aspect-ratio: 2 / 1; border-bottom: 1px solid var(--line); }
.k-identity-banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.k-identity-body { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 0 16px 16px; }
.k-identity-body .k-identity-logo { width: 56px; height: 56px; border-radius: 14px; font-size: 24px; margin: -26px 0 9px 4px; border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.k-identity-body strong { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.k-identity-body small { font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.k-identity-fields { display: flex; flex-direction: column; }
.k-identity-field { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.k-identity-field:first-child { border-top: 1px solid var(--line); }
.k-identity-field > div:first-child { flex: 1 1 220px; min-width: 0; }
.k-identity-field strong { display: block; font-weight: 700; font-size: 14.5px; }
.k-identity-field small { display: block; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); margin-top: 2px; }
.k-identity-field .k-btn-row { gap: 8px; }

/* Recadrage du logo ou de la bannière : le cadre reste fixe, l'image
   bouge dessous ; ce qui sort du cadre est voilé. */
.k-crop-stage { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: #111111; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.k-crop-stage.is-dragging { cursor: grabbing; }
.k-crop-stage:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.k-crop-stage > img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.k-crop-frame { position: absolute; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55); outline: 1.5px solid rgba(255, 255, 255, .9); pointer-events: none; }
/* La grille des tiers pendant le geste, comme sur Instagram. */
.k-crop-frame::before, .k-crop-frame::after { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .15s ease; }
.k-crop-frame::before { border-left: 1px solid rgba(255, 255, 255, .45); border-right: 1px solid rgba(255, 255, 255, .45); left: 33.333%; right: 33.333%; }
.k-crop-frame::after { border-top: 1px solid rgba(255, 255, 255, .45); border-bottom: 1px solid rgba(255, 255, 255, .45); top: 33.333%; bottom: 33.333%; }
.k-crop-stage.is-dragging .k-crop-frame::before, .k-crop-stage.is-dragging .k-crop-frame::after { opacity: 1; }
.k-crop-zoom { display: flex; align-items: center; gap: 10px; color: var(--ink-3); }
.k-crop-zoom input { flex: 1; min-width: 0; accent-color: var(--ink); }
.k-crop-actions { display: flex; justify-content: flex-end; gap: 8px; }
.k-identity-status { margin: 12px 0 0; min-height: 1.4em; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.k-identity-status.is-error { color: var(--danger); }

.k-panel-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.k-panel-head > span { font-size: 13.5px; font-weight: 600; color: var(--ink-3); }
.k-sectors { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.k-sector { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.k-sector > .k-wall { width: 40px; height: 40px; border-radius: 9px; flex-shrink: 0; }
.k-sector > span:nth-child(2) { flex: 1; min-width: 0; }
.k-sector strong { display: block; font-weight: 700; font-size: 14.5px; }
.k-sector small { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.k-tag { height: 24px; padding: 0 9px; border-radius: 7px; background: var(--fill); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; white-space: nowrap; }
.k-sectors-empty { padding: 18px 0; font-size: 14px; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.k-add-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; align-items: flex-end; }

.k-icon-btn { width: 34px; height: 34px; border-radius: 8px; border: none; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-3); padding: 0; }
.k-icon-btn:hover { background: var(--fill); color: var(--ink); }

.k-savebar { position: sticky; bottom: 0; z-index: 10; margin: 0 -44px; padding: 14px 44px 18px; background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.k-savebar [role="status"] { flex: 1 1 200px; font-size: 13.5px; font-weight: 600; color: var(--ink-3); }
.k-savebar [role="status"].is-dirty { color: var(--ink); }
.k-savebar [role="status"].is-saved { color: var(--ok-ink); }
.k-savebar [role="status"].is-error { color: var(--danger); }
@media (max-width: 760px) { .k-savebar { margin: 0 -16px; padding: 14px 16px 18px; } }
@media (max-width: 520px) { .k-savebar [role="status"] { flex-basis: 100%; } }

/* ── Tableaux (ouvreurs, factures) ──────────────────────────── */

.k-table-box { position: relative; border: 1px solid var(--line); border-radius: 16px; overflow-x: auto; }
.k-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.k-table th { text-align: left; padding: 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.k-table td { padding: 12px; border-bottom: 1px solid var(--line); }
.k-table tbody tr:last-child td { border-bottom: none; }
.k-table th:first-child, .k-table td:first-child { padding-left: 18px; }
.k-table th:last-child, .k-table td:last-child { padding-right: 18px; }
.k-table .is-right { text-align: right; }

/* Ouvreurs */
.k-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.k-search { position: relative; flex: 0 1 260px; min-width: 180px; }
.k-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.k-app .k-search .k-field { height: 38px; padding-left: 36px; border-radius: 99px; }
.k-members { min-width: 760px; }
.k-members tbody tr:hover { background: #FAFAFA; }
.k-member { display: flex; align-items: center; gap: 11px; }
.k-member > .k-avatar { width: 34px; height: 34px; }
.k-member.is-pending > .k-avatar { opacity: .55; }
.k-member-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.k-member small { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.k-member .k-badge { height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; }
.k-badge--me { background: var(--fill); color: var(--ink-2); }
.k-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.k-chip { height: 24px; padding: 0 8px 0 4px; border-radius: 99px; background: var(--fill); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.k-chip i { width: 16px; height: 16px; border-radius: 50%; background: var(--c); }
.k-select { height: 34px; padding: 0 28px 0 10px; border: none; border-radius: 8px; background: var(--fill); font-family: var(--font); font-size: 13.5px; font-weight: 500; color: var(--ink); cursor: pointer; }
.k-muted { color: var(--ink-3); }
.k-nowrap { white-space: nowrap; }
.k-actions { white-space: nowrap; }
.k-actions > span { display: inline-flex; align-items: center; gap: 6px; }
.k-actions .k-confirm-q { font-size: 13px; color: var(--ink-2); margin-right: 4px; }
.k-table-empty { padding: 28px 18px; text-align: center; font-size: 14px; color: var(--ink-3); }

.k-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.k-roles h2 { grid-column: 1 / -1; margin: 6px 0 0; }
.k-role { padding: 16px; border-radius: 14px; background: var(--bg-soft); display: flex; flex-direction: column; gap: 6px; }
.k-role strong { font-weight: 700; font-size: 14.5px; }
.k-role span { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }

.k-invite { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.k-invite-head { padding-right: 40px; }
.k-invite-head h2 { margin: 0 0 6px; font-weight: 700; font-size: 24px; letter-spacing: -0.02em; }
.k-invite-head p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-3); }
.k-invite fieldset { border: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.k-invite legend { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.k-check { width: 18px; height: 18px; accent-color: var(--ink); margin: 0; flex-shrink: 0; }
.k-check-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--fill); cursor: pointer; font-size: 14px; font-weight: 500; }
.k-check-row i { width: 20px; height: 20px; border-radius: 50%; background: var(--c); }
.k-role-choice { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 12px; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.k-role-choice:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--ink); }
.k-role-choice .k-check { margin-top: 1px; }
.k-role-choice strong { display: block; font-weight: 700; font-size: 14px; }
.k-role-choice small { display: block; font-size: 13px; line-height: 1.45; color: var(--ink-3); margin-top: 2px; }

/* Abonnement */
.k-plan-box { border: 1.5px solid var(--ink); border-radius: 18px; overflow: hidden; }
.k-plan-top { padding: 22px; display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; justify-content: space-between; }
.k-plan-top > div:first-child { display: flex; flex-direction: column; gap: 8px; }
.k-plan-top h2 { margin: 0; font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.k-plan-top p { margin: 0; font-size: 14px; color: var(--ink-3); }
.k-plan-next { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.k-plan-next span { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.k-plan-next strong { font-weight: 700; font-size: 34px; letter-spacing: -0.03em; line-height: 1; }
.k-plan-next small { font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 520px) { .k-plan-next { align-items: flex-start; text-align: left; } }
.k-lines { border-top: 1px solid var(--line); }
.k-line { display: flex; align-items: center; gap: 12px; padding: 13px 22px; border-bottom: 1px solid var(--line); }
.k-line > span:nth-child(2) { flex: 1; min-width: 0; }
.k-line strong { display: block; font-weight: 600; font-size: 14.5px; }
.k-line small { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.k-line > b { font-weight: 700; font-size: 14.5px; min-width: 90px; text-align: right; }
.k-plan-cycle { padding: 16px 22px; background: var(--bg-soft); display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; }
.k-plan-cycle .k-seg { background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--line); }
.k-plan-cycle p { flex: 1 1 260px; margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.k-plan-cycle .k-btn--secondary { background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--line-2); }

.k-cards-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; align-items: stretch; }
.k-box { border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.k-box h2 { margin: 0; font-weight: 700; font-size: 16px; }
.k-box > .k-btn { align-self: flex-start; margin-top: auto; }
.k-box [data-payment] .k-btn { margin-top: 14px; }
.k-card-row { display: flex; align-items: center; gap: 12px; }
.k-visa { width: 46px; height: 32px; border-radius: 6px; background: #1A1F71; color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-weight: 800; font-style: italic; font-size: 13px; letter-spacing: .02em; flex-shrink: 0; }
.k-card-row strong { display: block; font-weight: 600; font-size: 14.5px; }
.k-card-row small { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.k-box address { font-style: normal; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.k-box address strong { color: var(--ink); font-weight: 600; }
.k-code { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg-soft); }
.k-code code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 700; font-size: 13px; }
.k-code span { flex: 1; font-size: 12.5px; color: var(--ink-3); }
.k-code-form { display: flex; gap: 8px; margin-top: auto; }
.k-code-form label { flex: 1; min-width: 0; }
.k-app .k-code-form .k-field { height: 38px; text-transform: uppercase; }
.k-app .k-code-form .k-btn { height: 38px; }
.k-error { font-size: 13px; font-weight: 600; color: var(--danger); }
/* Serveur injoignable, droits refusés : en tête de la page. */
.k-alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--danger-bg); color: var(--danger); font-size: 14px; font-weight: 600; }
.k-alert span { flex: 1; min-width: 0; }
.k-alert .k-link-btn { color: inherit; }
/* Le temps du premier chargement, rien de la page n'est montré. */
.k-main[aria-busy="true"] > :not(.k-alert) { visibility: hidden; }

.k-invoices { min-width: 620px; }
.k-invoices td { padding-block: 13px; }
.k-mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; color: var(--ink-3); }
.k-pdf { display: inline-flex; width: 32px; height: 32px; border-radius: 8px; align-items: center; justify-content: center; color: var(--ink-2); }
.k-pdf:hover { background: var(--fill); color: var(--ink); }

.k-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.k-more > div { padding: 20px; border-radius: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.k-more > div:first-of-type { background: var(--bg-soft); }
.k-more > div:last-of-type { border: 1px solid var(--line); }
.k-more strong { font-weight: 700; font-size: 15px; }
.k-more p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.k-more a, .k-more button { margin-top: 4px; }

/* « Ajouter une salle » : un bouton, plus un lien. */
button.k-add-gym { width: 100%; font-family: var(--font); background: transparent; cursor: pointer; }
.k-sector .k-count { font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }

/* Nommer un ouvreur : comptes trouvés par leur nom d'utilisateur. */
.k-results { display: flex; flex-direction: column; gap: 6px; }
.k-results:empty { display: none; }
.k-results .k-check-row .k-avatar { width: 26px; height: 26px; font-size: 11.5px; }
.k-results .k-check-row small { margin-left: auto; font-size: 12.5px; color: var(--ink-3); }
.k-check-row:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--ink); }
.k-results-hint { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-3); }

/* Abonnement des salles (espace.js, espace-abonnement.js). */
.k-notice { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-ink); font-size: 14px; font-weight: 600; }
.k-notice > span { flex: 1; min-width: 0; }
.k-notice a { color: inherit; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.k-notice--danger { background: var(--danger-bg); color: var(--danger); }
.k-main[aria-busy="true"] > .k-notice { visibility: hidden; }
.k-badge--danger { background: var(--danger-bg); color: var(--danger); }
.k-gym-head .k-badge { margin-left: auto; align-self: flex-start; }
.k-gym-foot .k-btn { height: 32px; }
.k-line-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.k-line-actions .k-btn { height: 32px; }
@media (max-width: 560px) {
  .k-line { flex-wrap: wrap; }
  .k-line-actions { width: 100%; }
}
.k-box p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.k-code-form { flex-wrap: wrap; }
.k-code-form .k-select { height: 38px; flex: 1 1 100%; }
.k-code-form .k-select[hidden] { display: none; }
