/* App-shell split list + detail CRUD (JavaFX *CrudView / *FormView mirror) */

.app-crud__breadcrumb,
.person-crud__breadcrumb {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
}

.app-crud__breadcrumb a,
.person-crud__breadcrumb a {
  color: var(--app-blue, #1e40af);
  font-weight: 600;
  text-decoration: none;
}

.app-crud__breadcrumb a:hover,
.person-crud__breadcrumb a:hover {
  text-decoration: underline;
}

/* Layout shell: table-only | split + divider | form fullscreen */
.app-crud,
.person-crud {
  --crud-list-ratio: 38%;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: calc(100vh - 220px);
  gap: 0;
}

.crud-layout--table .crud-layout__detail,
.crud-layout--table .crud-layout__divider {
  display: none;
}

.crud-layout--table .crud-layout__list {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}

.crud-layout--split .crud-layout__list {
  flex: 0 0 var(--crud-list-ratio);
  min-width: 280px;
  max-width: 85%;
}

.crud-layout--split .crud-layout__divider {
  display: block;
}

.crud-layout--split .crud-layout__detail {
  flex: 1 1 auto;
  min-width: 280px;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  container-type: inline-size;
  container-name: crud-detail;
}

.crud-layout--split .crud-layout__detail > .app-entity-form,
.crud-layout--split .crud-layout__detail > .person-form,
.crud-layout--split .crud-layout__detail > .app-course-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* Families: member block sits below the address form (sibling, not inside it). */
.crud-layout--split .crud-layout__detail:has(> .app-form-section),
.crud-layout--fullscreen .crud-layout__detail:has(> .app-form-section) {
  overflow: auto;
}

.crud-layout--split .crud-layout__detail > .app-entity-form:has(+ .app-form-section),
.crud-layout--fullscreen .crud-layout__detail > .app-entity-form:has(+ .app-form-section) {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
}

.crud-layout--split .crud-layout__detail > .app-form-section,
.crud-layout--fullscreen .crud-layout__detail > .app-form-section {
  flex: 0 0 auto;
  margin: 0 1rem 1rem;
}

.crud-layout--fullscreen .crud-layout__list,
.crud-layout--fullscreen .crud-layout__divider {
  display: none;
}

.crud-layout--fullscreen .crud-layout__detail {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  container-type: inline-size;
  container-name: crud-detail;
}

.crud-layout--fullscreen .crud-layout__detail > .app-entity-form,
.crud-layout--fullscreen .crud-layout__detail > .person-form,
.crud-layout--fullscreen .crud-layout__detail > .app-course-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.crud-layout__divider {
  flex: 0 0 6px;
  align-self: stretch;
  margin: 0.75rem 0;
  border-radius: 3px;
  background: #e5e7eb;
  cursor: col-resize;
  touch-action: none;
  position: relative;
  z-index: 3;
  flex-shrink: 0;
}

.crud-layout__divider:hover,
.crud-layout__divider--dragging {
  background: #dc2626;
}

.crud-layout__modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--app-line, rgba(229, 231, 235, 0.5));
  background: var(--app-glass-toolbar, rgba(249, 250, 251, 0.45));
  -webkit-backdrop-filter: blur(var(--app-glass-blur, 6px));
  backdrop-filter: blur(var(--app-glass-blur, 6px));
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.crud-layout__mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 34px;
  padding: 0.25rem 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.crud-layout__mode-btn:hover {
  background: #f9fafb;
  border-color: #cbd5e1;
}

.crud-layout__mode-btn--active {
  background: #fef2f2;
  border-color: #dc2626;
  color: #dc2626;
}

/* Icon-only CRUD toolbar (JavaFX crud-button-icon-only parity) */
.app-btn.app-btn--icon,
a.app-btn.app-btn--icon {
  min-width: 38px;
  min-height: 34px;
  padding: 0.3rem 0.45rem;
  gap: 0;
}

.app-btn.app-btn--icon.app-btn--sm,
a.app-btn.app-btn--icon.app-btn--sm {
  min-width: 38px;
  min-height: 34px;
  padding: 0.3rem 0.45rem;
}

.app-btn--icon .crud-icon,
.crud-layout__mode-btn .crud-icon {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
}

.crud-layout__mode-btn .crud-icon--mode {
  width: 1.4rem;
  height: 1.4rem;
}

.app-btn--icon .crud-icon--danger,
.app-btn--danger.app-btn--icon {
  color: var(--app-red, #dc2626);
}

.app-btn--primary.app-btn--icon .crud-icon {
  color: #fff;
}

.app-crud__toolbar-main,
.person-crud__toolbar-main {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

body.crud-layout--dragging {
  user-select: none;
  cursor: col-resize;
}

body.crud-layout--dragging * {
  cursor: col-resize;
}

@media (max-width: 960px) {
  .app-crud,
  .person-crud {
    flex-direction: column;
    min-height: 0;
  }

  .crud-layout--split .crud-layout__list {
    flex: 0 0 auto;
    max-width: none;
    min-height: 280px;
  }

  .crud-layout--split .crud-layout__divider {
    display: none;
  }

  .crud-layout--split .crud-layout__detail {
    min-width: 0;
  }
}

.app-crud__list-panel,
.app-crud__detail-panel,
.person-crud__list-panel,
.person-crud__detail-panel {
  background: var(--app-glass, rgba(255, 255, 255, 0.3));
  border: 1px solid var(--app-line, rgba(229, 231, 235, 0.5));
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  -webkit-backdrop-filter: blur(var(--app-glass-blur, 6px));
  backdrop-filter: blur(var(--app-glass-blur, 6px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 420px;
}

.app-crud__toolbar,
.person-crud__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--app-line, rgba(229, 231, 235, 0.5));
  background: var(--app-glass-toolbar, rgba(249, 250, 251, 0.45));
  -webkit-backdrop-filter: blur(var(--app-glass-blur, 6px));
  backdrop-filter: blur(var(--app-glass-blur, 6px));
}

.app-crud__toolbar-main,
.person-crud__toolbar-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.app-crud__filter,
.person-crud__filter {
  flex: 1 1 140px;
  min-width: 120px;
}

.app-crud__filter-input,
.person-crud__filter-input {
  width: 100%;
  padding: 0.4rem 0.65rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font: inherit;
  font-size: 0.8125rem;
}

.app-crud__facet-filters {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
}

.app-crud__facet-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #4b5563;
  white-space: nowrap;
}

.app-crud__facet-filter-label {
  font-weight: 600;
}

.app-crud__facet-filter-input {
  padding: 0.35rem 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font: inherit;
  font-size: 0.8125rem;
  background: #fff;
}

.app-crud__count,
.person-crud__count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
}

.app-crud__table-wrap,
.person-crud__table-wrap {
  flex: 1 1 auto;
  overflow: auto;
}

.app-crud__table,
.person-crud__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.app-crud__table th,
.person-crud__table th {
  position: sticky;
  top: 0;
  background: var(--app-glass-header, rgba(243, 244, 246, 0.55));
  -webkit-backdrop-filter: blur(var(--app-glass-blur, 6px));
  backdrop-filter: blur(var(--app-glass-blur, 6px));
  text-align: left;
  padding: 0.5rem 0.65rem;
  font-weight: 700;
  color: #374151;
  border-bottom: 1px solid var(--app-line, rgba(229, 231, 235, 0.5));
  z-index: 1;
}

.app-crud__th--sortable {
  cursor: pointer;
  user-select: none;
  padding-right: 1.35rem;
  white-space: nowrap;
}

.app-crud__th--sortable:hover {
  background: rgba(233, 236, 241, 0.65);
}

.app-crud__th--sortable:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.app-crud__th--sortable::after {
  content: "⇅";
  margin-left: 0.35rem;
  font-size: 0.65rem;
  opacity: 0.4;
}

.app-crud__th--sort-asc::after {
  content: "▲";
  opacity: 0.9;
}

.app-crud__th--sort-desc::after {
  content: "▼";
  opacity: 0.9;
}

.app-crud__table td,
.person-crud__table td {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.app-crud__row,
.person-crud__row {
  cursor: pointer;
}

.app-crud__row:hover,
.person-crud__row:hover {
  background: rgba(220, 38, 38, 0.18);
}

.app-crud__row--selected,
.person-crud__row--selected {
  background: rgba(220, 38, 38, 0.09);
}

.app-crud__row--selected:hover,
.person-crud__row--selected:hover {
  background: rgba(220, 38, 38, 0.22);
}

.app-crud__row--hidden,
.person-crud__row--hidden {
  display: none;
}

.app-crud__row--future {
  font-style: italic;
  color: var(--app-muted, #64748b);
}

.app-crud__row--expired {
  opacity: 0.7;
  color: var(--app-muted, #64748b);
}

.app-crud__row--expired td:nth-child(2) {
  text-decoration: line-through;
}

.app-crud__detail-panel,
.person-crud__detail-panel {
  min-width: 0;
}

.app-entity-form,
.person-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.app-entity-form__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--app-line, rgba(229, 231, 235, 0.5));
  background: var(--app-glass-toolbar, rgba(249, 250, 251, 0.45));
  -webkit-backdrop-filter: blur(var(--app-glass-blur, 6px));
  backdrop-filter: blur(var(--app-glass-blur, 6px));
}

.app-entity-form__header strong {
  font-size: 0.95rem;
  font-weight: 800;
  color: #111827;
}

.app-entity-form__header-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.app-entity-form__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

fieldset.app-entity-form__body {
  border: none;
  margin: 0;
  min-width: 0;
}

.app-form-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

@container crud-detail (min-width: 640px) {
  .crud-layout--fullscreen .app-form-sections,
  .crud-layout--fullscreen .app-entity-form__body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.app-entity-form__grid,
.person-form__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.app-entity-form__field,
.person-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.app-entity-form__field[data-grade-obtenu-org]:not(.grade-obtenu-org--active) {
  display: none !important;
}

.app-entity-form__field--full,
.person-form__field--full {
  grid-column: 1 / -1;
}

.app-entity-form__field label,
.person-form__field label,
.app-entity-form__field-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b7280;
}

.app-entity-form__field-label {
  display: block;
  margin-bottom: 0.25rem;
}

.app-entity-form__field input,
.app-entity-form__field select,
.app-entity-form__field textarea,
.app-entity-form__field .searchable-select__input,
.person-form__field input,
.person-form__field select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font: inherit;
  font-size: 0.875rem;
  color: #111827;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.app-entity-form__field input:focus,
.app-entity-form__field select:focus,
.app-entity-form__field textarea:focus,
.app-entity-form__field .searchable-select__input:focus,
.person-form__field input:focus,
.person-form__field select:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.app-entity-form__field input[readonly],
.person-form__field input[readonly] {
  background: #f9fafb;
  color: #6b7280;
}

.app-form-section,
.person-form__card {
  padding: 1.125rem 1.25rem;
  border: 1px solid var(--app-line, rgba(229, 231, 235, 0.5));
  border-radius: 14px;
  background: var(--app-glass-strong, rgba(255, 255, 255, 0.42));
  -webkit-backdrop-filter: blur(var(--app-glass-blur, 6px));
  backdrop-filter: blur(var(--app-glass-blur, 6px));
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.03);
}

.app-form-section__title,
.person-form__card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: #111827;
}

.app-form-section__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.app-entity-form__subsection {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.app-entity-form__subsection-title {
  margin: 0 0 0.85rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #374151;
}

.app-entity-form__section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #111827;
  grid-column: 1 / -1;
}

.app-entity-form__section-title .app-icon {
  width: 20px;
  height: 20px;
}

.person-form__tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--app-line, rgba(229, 231, 235, 0.5));
  background: var(--app-glass-toolbar, rgba(249, 250, 251, 0.45));
  -webkit-backdrop-filter: blur(var(--app-glass-blur, 6px));
  backdrop-filter: blur(var(--app-glass-blur, 6px));
}

.person-form__tab {
  margin: 0;
  padding: 0.55rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #6b7280;
  cursor: pointer;
}

.person-form__tab:hover {
  color: #111827;
  background: rgba(255, 255, 255, 0.7);
}

.person-form__tab--active {
  background: #fff;
  color: #111827;
  border-color: #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.person-form__tab-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.person-form__panels {
  flex: 1 1 auto;
  overflow: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

.person-form__credential-strip {
  flex-shrink: 0;
  padding: 0.75rem 1rem 0;
}

.person-form__card--credential {
  margin-bottom: 0;
}

.person-form__card--credential .person-form__card-title {
  margin-bottom: 0.5rem;
}

.person-form__credential-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.person-form__field--credential-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.person-form__credential-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--app-blue, #1e40af);
  text-decoration: none;
}

.person-form__credential-link:hover {
  text-decoration: underline;
}

@container crud-detail (min-width: 520px) {
  .person-form__credential-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .person-form__field--credential-actions {
    grid-column: 1 / -1;
  }
}

.crud-layout--split .crud-layout__detail > .person-form__credential-strip,
.crud-layout--fullscreen .crud-layout__detail > .person-form__credential-strip {
  flex-shrink: 0;
}

.person-form__panel[hidden] {
  display: none !important;
}

.person-form__hint,
.app-entity-form__hint {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: #6b7280;
}

.app-page-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--app-line, rgba(229, 231, 235, 0.5));
  border-radius: 12px;
  background: var(--app-glass, rgba(255, 255, 255, 0.3));
  -webkit-backdrop-filter: blur(var(--app-glass-blur, 6px));
  backdrop-filter: blur(var(--app-glass-blur, 6px));
}

.app-page-tabs__tab {
  margin: 0;
  padding: 0.55rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #6b7280;
  text-decoration: none;
  cursor: pointer;
}

.app-page-tabs__tab:hover {
  color: #111827;
  background: rgba(255, 255, 255, 0.7);
}

.app-page-tabs__tab--active {
  background: #fff;
  color: #111827;
  border-color: #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.app-entity-form__field--checkbox label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
  color: #374151;
}

.person-form__checks {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
}

.person-form__checks label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
  color: #374151;
}

.app-flash {
  margin: 0 0 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
}

.app-flash--success {
  background: rgba(34, 197, 94, 0.15);
  color: #166534;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.app-flash--error {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.app-image-field,
.club-logo-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 100%;
}

.app-image-field__preview-frame,
.club-logo-field__preview-frame {
  flex: 0 0 auto;
  width: 6.5rem;
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  padding: 0.25rem;
  box-sizing: border-box;
}

.app-image-field__preview-frame--empty,
.club-logo-field__preview-frame--empty {
  background: #f9fafb;
  border-style: dashed;
}

.app-image-field--badge .app-image-field__preview-frame {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.2rem;
}

.app-image-field__preview,
.club-logo-field__preview {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.app-image-field__body,
.club-logo-field__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.app-image-field__toolbar,
.club-logo-field__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  position: relative;
}

.app-image-field__toolbar input[type="file"],
.club-logo-field__toolbar input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.app-image-field__clear,
.club-logo-field__clear {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.2;
  white-space: nowrap;
}

.app-image-field__clear::before,
.club-logo-field__clear::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 1.25rem;
  margin-right: 0.125rem;
  background: #e5e7eb;
}

.app-image-field__hint,
.club-logo-field__hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
}

/* Course form — time slot list + editor */
.course-time-slots__layout {
  display: flex;
  gap: 1rem;
  align-items: stretch;
}

.course-time-slots__list-pane {
  flex: 0 0 min(100%, 18rem);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 12rem;
}

.course-time-slots__list {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 10rem;
  max-height: 16rem;
  overflow: auto;
  border: 1px solid var(--app-border, #dbeafe);
  border-radius: 0.5rem;
  background: #fff;
}

.course-time-slots__item {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--app-border, #e2e8f0);
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.35;
}

.course-time-slots__item:last-child {
  border-bottom: none;
}

.course-time-slots__item:hover {
  background: #f8fafc;
}

.course-time-slots__item--selected {
  background: #eff6ff;
  color: var(--app-blue, #1e40af);
  font-weight: 600;
}

.course-time-slots__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.course-time-slots__editor {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 720px) {
  .course-time-slots__layout {
    flex-direction: column;
  }

  .course-time-slots__list-pane {
    flex-basis: auto;
  }
}

/* Function rows — list-editor (FK + dates) */
.function-rows__layout {
  display: flex;
  gap: 1rem;
  align-items: stretch;
}

.function-rows__list-pane {
  flex: 0 0 min(100%, 18rem);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 12rem;
}

.function-rows__list {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 10rem;
  max-height: 16rem;
  overflow: auto;
  border: 1px solid var(--app-border, #dbeafe);
  border-radius: 0.5rem;
  background: #fff;
}

.function-rows__item {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--app-border, #e2e8f0);
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.35;
}

.function-rows__item:last-child {
  border-bottom: none;
}

.function-rows__item:hover {
  background: #f8fafc;
}

.function-rows__item--selected {
  background: #eff6ff;
  color: var(--app-blue, #1e40af);
  font-weight: 600;
}

.function-rows__item--future {
  font-style: italic;
  color: var(--app-muted, #64748b);
}

.function-rows__item--expired {
  opacity: 0.65;
  text-decoration: line-through;
  color: var(--app-muted, #64748b);
}

.function-rows__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.function-rows__editor {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 720px) {
  .function-rows__layout {
    flex-direction: column;
  }

  .function-rows__list-pane {
    flex-basis: auto;
  }
}

/* Compact boolean toggle (filters / general) — smaller than .app-validation-switch */
.app-toggle {
  display: inline-flex;
  align-items: stretch;
  gap: 0.12rem;
  padding: 0.14rem;
  border: 1px solid var(--app-border, #dbeafe);
  border-radius: 999px;
  background: #fff;
  min-width: 0;
  width: max-content;
  max-width: 100%;
}

.app-toggle__option {
  flex: 0 1 auto;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.2;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
}

.app-toggle__option:hover:not(.app-toggle__option--active) {
  background: #f1f5f9;
}

.app-toggle__option--active {
  background: #1d4ed8;
  color: #fff;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.2);
}

.app-toggle__option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.18);
}

/* Enrollment validation switch */
.app-validation-switch {
  display: inline-flex;
  align-items: stretch;
  gap: 0.2rem;
  padding: 0.28rem;
  border: 1px solid var(--app-border, #dbeafe);
  border-radius: 999px;
  background: #fff;
  min-width: 18rem;
}

.app-validation-switch--three {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.app-validation-switch__option {
  flex: 1 1 50%;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.app-validation-switch--three .app-validation-switch__option {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.75rem 0.85rem;
  font-size: 0.88rem;
  line-height: 1.25;
}

.app-validation-switch__option:hover:not(.app-validation-switch__option--active) {
  background: #f1f5f9;
}

.app-validation-switch__option--active[data-validation-option="false"],
.app-validation-switch__option--active[data-validation-option="NONE"] {
  background: #b91c1c;
  color: #fff;
  box-shadow: 0 4px 14px rgba(185, 28, 28, 0.22);
}

.app-validation-switch__option--active[data-validation-option="true"],
.app-validation-switch__option--active[data-validation-option="EDITED"] {
  background: #15803d;
  color: #fff;
  box-shadow: 0 4px 14px rgba(21, 128, 61, 0.22);
}

.app-validation-switch__option--active[data-validation-option="EXTERNAL"] {
  background: #ea580c;
  color: #fff;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.24);
}

.app-club-bool-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  align-items: start;
}

.app-club-bool {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.app-club-bool .app-validation-switch {
  width: 100%;
  min-width: 0;
}

@media (max-width: 720px) {
  .app-club-bool-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.enrollment-payments__check-detail--hidden {
  display: none !important;
}

.enrollment-payments__encashed-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  cursor: pointer;
}

.enrollment-payments__encashed-label input {
  width: 1rem;
  height: 1rem;
}

/* Enrollment payments list + editor */
.enrollment-payments__summary {
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.enrollment-payments__layout {
  display: flex;
  gap: 1rem;
  align-items: stretch;
}

.enrollment-payments__list-pane {
  flex: 0 0 min(100%, 18rem);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 12rem;
}

.enrollment-payments__list {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 10rem;
  max-height: 16rem;
  overflow: auto;
  border: 1px solid var(--app-border, #dbeafe);
  border-radius: 0.5rem;
  background: #fff;
}

.enrollment-payments__item {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--app-border, #e2e8f0);
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.35;
}

.enrollment-payments__item:last-child {
  border-bottom: none;
}

.enrollment-payments__item:hover {
  background: #f8fafc;
}

.enrollment-payments__item--selected {
  background: #eff6ff;
  color: var(--app-blue, #1e40af);
  font-weight: 600;
}

.enrollment-payments__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.enrollment-payments__editor {
  flex: 1 1 auto;
  min-width: 0;
}

.enrollment-payments__refund-dialog {
  border: 1px solid var(--app-border, #dbeafe);
  border-radius: 0.5rem;
  padding: 0;
  max-width: 22rem;
}

.enrollment-payments__refund-dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
}

.enrollment-payments__refund-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
}

.enrollment-payments__refund-title {
  margin: 0;
  font-size: 1rem;
}

.enrollment-payments__refund-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.enrollment-payments__refund-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.enrollment-payments__refund-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

@media (max-width: 720px) {
  .enrollment-payments__layout {
    flex-direction: column;
  }

  .enrollment-payments__list-pane {
    flex-basis: auto;
  }
}

/* Hour / minute picker (web) */
.hour-minute-input {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
}

.hour-minute-input__hour,
.hour-minute-input__minute {
  width: auto;
  min-width: 4.25rem;
  flex: 0 1 auto;
}

.hour-minute-input__sep {
  font-weight: 700;
  color: #6b7280;
  user-select: none;
}

.hour-minute-input[data-disabled="true"] {
  opacity: 0.65;
}

.app-dl-grid {
  display: grid;
  grid-template-columns: minmax(8rem, auto) 1fr;
  gap: 0.35rem 1rem;
  margin: 0 0 1rem;
}

.app-dl-grid dt {
  margin: 0;
  color: #6b7280;
  font-weight: 600;
}

.app-dl-grid dd {
  margin: 0;
}

.app-simple-list {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
}

.app-simple-list li {
  margin: 0.25rem 0;
}

.app-subcard {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.app-entity-form__placeholder {
  padding: 1.5rem;
}

/* Enrollment edit: long form (options, réductions, documents) — single column + scrollable body */
.app-enrollment-edit .app-entity-form__body {
  grid-template-columns: 1fr;
}

.app-enrollment-edit__adhesion-blocks,
.app-enrollment-edit [data-enrollment-reductions-host] {
  grid-column: 1 / -1;
}

.app-enrollment-edit .adhesion-form-section,
.app-enrollment-edit .adhesion-subsection {
  margin: 0;
}

.app-enrollment-edit__category-field {
  margin-bottom: 1rem;
}

.app-entity-form__field .searchable-select {
  width: 100%;
}

.app-entity-form__field .searchable-select__input {
  cursor: pointer;
  background-color: #fff;
  padding-right: 4.25rem;
}

.app-entity-form__field .searchable-select__input::placeholder {
  color: #9ca3af;
}

.app-enrollment-edit__authorizations-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.app-enrollment-edit__authorizations-grid--single {
  grid-template-columns: 1fr;
}

.app-enrollment-edit__public-payment {
  margin-top: 0.5rem;
}

.app-enrollment-edit__payment-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.app-enrollment-edit__payment-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}

.app-enrollment-edit__payment-stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
}

.app-enrollment-edit__payment-stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
}

/* Progression dossier adhésion (rouge → vert) */
.app-enrollment-workflow {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.app-enrollment-workflow__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.app-enrollment-workflow__title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #374151;
}

.app-enrollment-workflow__track {
  height: 0.45rem;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.app-enrollment-workflow__fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.app-enrollment-workflow__steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-enrollment-workflow__steps--five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.app-enrollment-workflow__steps li {
  font-size: 0.6875rem;
  font-weight: 600;
  text-align: center;
  color: #9ca3af;
}

.app-enrollment-workflow__steps li.app-enrollment-workflow__step--reached {
  color: #4b5563;
}

.app-enrollment-workflow__steps li.app-enrollment-workflow__step--current {
  color: #111827;
  font-weight: 800;
}

.app-enrollment-status-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}

.app-enrollment-status-badge--pending-payment {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.app-enrollment-status-badge--partially-paid {
  background: rgba(194, 65, 12, 0.14);
  color: #9a3412;
}

.app-enrollment-status-badge--overpaid {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
}

.app-enrollment-status-badge--pending-check {
  background: rgba(234, 88, 12, 0.12);
  color: #c2410c;
}

.app-enrollment-status-badge--pending-validation {
  background: rgba(202, 138, 4, 0.14);
  color: #a16207;
}

.app-enrollment-status-badge--confirmed-pending-licence {
  background: rgba(101, 163, 13, 0.14);
  color: #4d7c0f;
}

.app-enrollment-status-badge--confirmed {
  background: rgba(101, 163, 13, 0.14);
  color: #4d7c0f;
}

.app-enrollment-status-badge--licensed {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.app-enrollment-status-badge--external {
  background: rgba(8, 145, 178, 0.12);
  color: #0e7490;
}

.app-crud__table .app-enrollment-status-badge {
  font-size: 0.75rem;
}

.app-form-actions--centered {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding-top: 0.5rem;
}

@media (max-width: 900px) {
  .app-enrollment-edit__authorizations-grid,
  .app-enrollment-edit__payment-stats {
    grid-template-columns: 1fr;
  }

  .app-enrollment-workflow__steps--five {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-enrollment-edit__payment-stats {
    grid-template-columns: 1fr;
  }
}

.searchable-select {
  position: relative;
}

.searchable-select__control {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
}

.searchable-select__input {
  width: 100%;
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 4.25rem;
  box-sizing: border-box;
}

.searchable-select__input::-webkit-search-cancel-button,
.searchable-select__input::-webkit-search-decoration {
  display: none;
}

.searchable-select__actions {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.125rem;
  padding-right: 0.35rem;
  pointer-events: none;
}

.searchable-select__clear,
.searchable-select__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1;
  pointer-events: auto;
}

.searchable-select__clear:hover,
.searchable-select__toggle:hover {
  background: #f3f4f6;
  color: #111827;
}

.searchable-select__clear:focus-visible,
.searchable-select__toggle:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 1px;
}

.searchable-select__clear[hidden] {
  display: none;
}

.searchable-select__toggle-icon {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -2px);
}

.searchable-select--single-option .searchable-select__input {
  padding-right: 0.65rem;
}

.searchable-select__actions[hidden] {
  display: none;
}

.app-secret-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.app-secret-field__control {
  position: relative;
  display: flex;
  align-items: stretch;
}

.app-secret-field__input {
  width: 100%;
  padding-right: 2.5rem;
}

.app-secret-field__unlock {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.app-secret-field__unlock:hover {
  background: #f3f4f6;
  color: #111827;
}

.app-secret-field__unlock:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 1px;
}

.app-secret-field__unlock-icon {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.app-secret-field__unlock-icon--masked {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h2c0-1.66 1.34-3 3-3s3 1.34 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h2c0-1.66 1.34-3 3-3s3 1.34 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2z'/%3E%3C/svg%3E");
}

.app-secret-field__unlock-icon--visible {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z'/%3E%3C/svg%3E");
}

.app-secret-field__hint {
  margin: 0;
  font-size: 0.8125rem;
}

.searchable-select__list {
  position: fixed;
  z-index: 3000;
  left: 0;
  right: auto;
  min-width: 12rem;
  max-height: 12rem;
  overflow: auto;
  margin: 0.25rem 0 0;
  padding: 0.25rem 0;
  list-style: none;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.searchable-select__option {
  display: block;
  width: 100%;
  padding: 0.45rem 0.75rem;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.searchable-select__option--with-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.searchable-select__option-icon,
.searchable-select__selected-icon {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
  border-radius: 3px;
}

.searchable-select[data-icon-size="28"] .searchable-select__option-icon,
.searchable-select[data-icon-size="28"] .searchable-select__selected-icon {
  width: 1.75rem;
  height: 1.75rem;
}

.searchable-select__control--with-icon .searchable-select__selected-icon {
  align-self: center;
  margin-left: 0.5rem;
}

.searchable-select__control--with-icon .searchable-select__input {
  padding-left: 0.35rem;
}

.searchable-select__option:hover,
.searchable-select__option:focus {
  background: #f3f4f6;
}

.grade-ref-picker__row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}

.grade-ref-picker__select {
  flex: 1 1 auto;
  min-width: 0;
}

.grade-ref-picker__preview {
  flex: 0 0 auto;
  width: 6.5rem;
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  overflow: hidden;
}

.grade-ref-picker__preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.grade-ref-picker__preview-empty {
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: center;
  padding: 0.35rem;
}

/*
 * Bandeaux are wide strips (~4:1+). A fixed 50×25 box with object-fit:contain
 * collapses painted height to ~12px. Lock height; let width follow aspect ratio.
 */
.person-grade-icon {
  height: 25px;
  width: auto;
  max-width: 100px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
}

.app-crud__cell--grade-icon,
.app-crud__col--grade-icon {
  width: 7rem;
  min-width: 7rem;
  text-align: center;
}

.app-crud__cell--season-grades {
  width: 12rem;
  min-width: 12rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.season-grade-snapshot {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 25px;
  overflow: hidden;
  border-radius: 2px;
  background: #f3f4f6;
}

.season-grade-snapshot__item {
  flex: 1 1 0;
  min-width: 0;
  height: 25px;
  overflow: hidden;
}

.season-grade-snapshot__item + .season-grade-snapshot__item {
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.45);
}

.season-grade-snapshot__bandeau {
  display: block;
  width: 100%;
  height: 25px;
  object-fit: cover;
  object-position: left center;
}

.kata-ref__icon {
  display: block;
  width: 2rem;
  height: 2rem;
  object-fit: contain;
}

.kata-ref__media-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
}

.kata-ref__media-row {
  display: grid;
  grid-template-columns: auto 5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.kata-ref__embusen-thumb {
  display: block;
  width: 5rem;
  height: 3.25rem;
  object-fit: contain;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
}

.person-form__photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
  align-items: start;
}

.latest-grade-preview {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.latest-grade-preview > label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #4b5563;
}

.latest-grade-preview__frame {
  width: 100%;
  max-width: 11rem;
  min-height: 7.5rem;
}

.latest-grade-preview__img {
  max-height: 7.5rem;
}

.latest-grade-preview__label {
  margin: 0;
  font-size: 0.8125rem;
}

.searchable-multi__list {
  margin-top: 0.5rem;
}

.searchable-multi-select__selected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.searchable-multi-select__selected:empty {
  display: none;
  margin-bottom: 0;
}

.searchable-multi-select__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  max-width: 100%;
  padding: 0.2rem 0.45rem;
  font-size: 0.875rem;
  line-height: 1.3;
  border-radius: 999px;
  background: #e5e7eb;
  color: #111827;
}

.searchable-multi-select__chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-multi-select__chip-remove {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0 0.15rem;
  line-height: 1;
  font-size: 1rem;
  color: #6b7280;
}

.searchable-multi-select__chip-remove:hover,
.searchable-multi-select__chip-remove:focus {
  color: #111827;
}

.list-add-field {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.list-add-field__empty-hint {
  margin: 0;
}

.list-add-field__empty-hint[hidden] {
  display: none;
}

.list-add-field__table-wrap[hidden] {
  display: none;
}

.list-add-field__table {
  margin: 0;
}

.list-add-field__actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.list-add-field__add-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
}

.list-add-field__picker {
  flex: 1 1 14rem;
  min-width: 0;
}

.list-add-field__add-action {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  padding-bottom: 0.15rem;
}

.searchable-select--add-picker .searchable-select__input {
  padding-right: 2.25rem;
}

.course-affectations__filters-block,
.course-affectations__results-block {
  border: 1px solid var(--app-line, rgba(229, 231, 235, 0.5));
  border-radius: 14px;
  background: var(--app-glass, rgba(255, 255, 255, 0.3));
  -webkit-backdrop-filter: blur(var(--app-glass-blur, 6px));
  backdrop-filter: blur(var(--app-glass-blur, 6px));
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.03);
}

.course-affectations__filters-block {
  margin: 0;
  overflow: visible;
}

.course-affectations__filters-block[hidden] {
  display: none !important;
}

.course-affectations__filters {
  margin: 0;
  padding: 1rem 1.1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.course-affectations__bridge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.15rem 0;
  padding: 0.45rem 0.25rem;
}

.course-affectations__bridge-line {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, #d1d5db 12%, #d1d5db 88%, transparent);
}

.course-affectations__bridge-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.4rem 0.9rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.course-affectations__bridge-toggle:hover {
  border-color: #fca5a5;
  color: #b91c1c;
  background: #fef2f2;
}

.course-affectations__bridge-toggle:focus-visible {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.course-affectations__bridge-toggle[aria-expanded="false"] {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fef2f2;
}

/* Shared CRUD list filters (grades obtenus, etc.) — same bridge pattern as affectations */
.app-crud__filters-block {
  margin: 0 0 0.15rem;
  border: 1px solid var(--app-line, rgba(229, 231, 235, 0.5));
  border-radius: 14px;
  background: var(--app-glass, rgba(255, 255, 255, 0.3));
  -webkit-backdrop-filter: blur(var(--app-glass-blur, 6px));
  backdrop-filter: blur(var(--app-glass-blur, 6px));
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.03);
  overflow: visible;
  max-width: 100%;
  box-sizing: border-box;
}

.app-crud__filters-block[hidden] {
  display: none !important;
}

.app-crud__filters {
  margin: 0;
  padding: 1rem 1.1rem;
  border: 0;
  min-width: 0;
}

.app-crud__filters-rows {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.app-crud__filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.app-crud__filters-row--single {
  flex-wrap: wrap;
}

.app-crud__filters-row .app-entity-form__field {
  margin: 0;
  min-width: 10rem;
  flex: 0 1 14rem;
}

.app-crud__filters-row .app-entity-form__field--grow {
  flex: 1 1 12rem;
  min-width: 0;
}

.crud-layout--split .app-crud__filters-row--single {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.crud-layout--split .app-crud__filters-row .app-entity-form__field,
.crud-layout--split .app-crud__filters-row .app-entity-form__field--grow,
.crud-layout--split .app-crud__filters-row .app-toggle,
.crud-layout--split .app-crud__filters-inline {
  width: 100%;
  max-width: 100%;
}

.crud-layout--split .app-crud__filters-inline {
  justify-content: space-between;
}

.crud-layout--split .app-crud__filters-inline > select {
  min-width: 0;
  flex: 1 1 auto;
}

.crud-layout__detail .app-crud__filters-block,
.crud-layout__detail .app-crud__filters-bridge {
  display: none !important;
}

.crud-layout--fullscreen .app-crud__filters-block,
.crud-layout--fullscreen .app-crud__filters-bridge {
  display: none !important;
}

.crud-layout--split .grades-obtenus__list-filters,
.crud-layout--split .grades-obtenus__list-filters-bridge {
  max-width: 100%;
  overflow: hidden;
  contain: paint;
}

.crud-layout--split .grades-obtenus__filters-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.app-crud__filters-row .app-toggle {
  align-self: center;
  margin-bottom: 0;
  flex: 0 0 auto;
}

.app-crud__filters-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.app-crud__filters-inline > label {
  margin: 0;
  white-space: nowrap;
  font-weight: 600;
  color: #374151;
}

.app-crud__filters-inline > select {
  min-width: 7rem;
}

.app-crud__filters-bridge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.15rem 0 0.65rem;
  padding: 0.45rem 0.25rem;
}

.app-crud__filters-bridge-line {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, #d1d5db 12%, #d1d5db 88%, transparent);
}

.app-crud__filters-bridge-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.4rem 0.9rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.app-crud__filters-bridge-toggle:hover {
  border-color: #fca5a5;
  color: #b91c1c;
  background: #fef2f2;
}

.app-crud__filters-bridge-toggle:focus-visible {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.app-crud__filters-bridge-toggle[aria-expanded="false"] {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fef2f2;
}

.app-crud__filters-actions {
  display: flex;
  align-items: flex-end;
  padding-bottom: 0.15rem;
}

.course-affectations__results-block {
  margin: 0;
  padding: 0.85rem 0 0.75rem;
  overflow: hidden;
}

.course-affectations .app-crud__list-panel {
  overflow: visible;
}

.course-affectations__filters-block .app-entity-form__field input,
.course-affectations__filters-block .app-entity-form__field select,
.course-affectations__filters-block .membership-filter-select,
.course-affectations__filters-block .audience-picker__search-input {
  padding: 0.65rem 0.85rem;
  min-height: 2.65rem;
  line-height: 1.35;
  box-sizing: border-box;
}

.course-affectations__filters-block .app-entity-form__field .searchable-select__input {
  padding: 0.65rem 4.25rem 0.65rem 0.85rem;
  min-height: 2.65rem;
  line-height: 1.35;
  box-sizing: border-box;
}

.course-affectations__filters-block .searchable-select--single-option .searchable-select__input {
  padding-right: 0.85rem;
}

.course-affectations__course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.35rem 0.75rem;
  margin: 0.5rem 0 0.75rem;
}

.course-affectations__course-option {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.875rem;
  line-height: 1.35;
}

.course-affectations__filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.course-affectations__table-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 0.75rem;
  margin: 0 0 0.5rem;
  padding: 0 1rem 0 1rem;
}

.course-affectations__table-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-left: auto;
}

.course-affectations__table-header-spacer {
  flex: 1 1 2rem;
  min-width: 1rem;
}

.course-affectations__table-filter {
  flex: 0 1 18rem;
  min-width: 10rem;
  max-width: 22rem;
  margin: 0;
}

.course-affectations__filtered-count {
  color: #b91c1c;
  background: #fef2f2;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.course-affectations__total-count {
  margin: 0.65rem 0 0;
  padding: 0 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #6b7280;
}

body.app-shell-body:has(.course-affectations) .app-topbar__intro {
  max-width: 96ch;
}

.app-crud__context-menu {
  position: fixed;
  z-index: 1200;
  min-width: 11rem;
  padding: 0.35rem 0;
  margin: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.app-crud__context-menu-item {
  display: block;
  width: 100%;
  padding: 0.45rem 0.85rem;
  border: 0;
  background: transparent;
  color: #111827;
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
}

.app-crud__context-menu-item:hover:not(:disabled),
.app-crud__context-menu-item:focus-visible:not(:disabled) {
  background: rgba(220, 38, 38, 0.18);
  color: #7f1d1d;
  outline: none;
}

.app-crud__context-menu-item:disabled {
  opacity: 0.45;
  cursor: default;
}

.app-crud__context-menu-separator {
  height: 1px;
  margin: 0.35rem 0;
  background: #e5e7eb;
}

.app-family-members {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.app-family-members__table {
  margin: 0;
}

.app-family-members__actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.app-family-members__actions form {
  margin: 0;
}

.app-family-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.app-family-form__main {
  display: contents;
}

.app-family-form__body {
  display: contents;
}

.app-family-form__header {
  order: 0;
}

.app-family-form__members {
  order: 1;
}

.app-family-form__add-member {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.app-family-form__address {
  order: 2;
}

.app-course-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: auto;
}

.app-course-form__main {
  display: contents;
}

.app-course-form__body {
  display: contents;
}

.app-course-form__header {
  order: 0;
}

.app-course-form__course,
.app-course-form__instructors,
.app-course-form__planning,
.app-course-form > .app-form-section {
  width: 100%;
  max-width: none;
  min-width: 0;
  align-self: stretch;
  box-sizing: border-box;
}

.app-course-form__course {
  order: 1;
}

.app-course-form__instructors {
  order: 2;
}

.app-course-form__add-instructor {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
  width: 100%;
  max-width: none;
}

.app-course-form__planning {
  order: 3;
}

.app-course-form > .app-form-section,
.app-course-form > .app-entity-form__header {
  margin-left: 1rem;
  margin-right: 1rem;
}

.app-course-form > .app-form-section:first-of-type,
.app-course-form > .app-entity-form__header + .app-form-section {
  margin-top: 0;
}

.app-course-form > .app-form-section {
  margin-bottom: 1rem;
}

.app-course-form > .app-entity-form__header {
  margin-top: 0;
  margin-bottom: 0;
  padding: 1rem 1rem 0;
}

.app-course-instructors,
.app-course-form__instructors .list-add-field {
  width: 100%;
  max-width: none;
}

.app-course-instructors__table,
.app-course-form__instructors .list-add-field__table {
  width: 100%;
}

.app-course-form__instructors .list-add-field__add-row {
  width: 100%;
}

.app-course-form__instructors .list-add-field__picker,
.app-course-form__add-instructor .list-add-field__picker {
  flex: 1 1 auto;
  min-width: 0;
}

@container crud-detail (min-width: 640px) {
  .crud-layout--fullscreen .app-entity-form__body.app-course-form__body,
  .crud-layout--split .app-entity-form__body.app-course-form__body {
    display: contents;
  }
}

/* Entity edit dialog (person popup from licence / adhesion) */
.app-entity-dialog-root {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.app-entity-dialog-root.is-open {
  display: flex !important;
}

body.person-edit-dialog-open {
  overflow: hidden;
}

.app-entity-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.app-entity-dialog__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(960px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  min-height: 24rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

.app-entity-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
}

.app-entity-dialog__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.app-entity-dialog__close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}

.app-entity-dialog__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.5rem 0.75rem 0.75rem;
}

.person-form--dialog .person-form__panels {
  max-height: none;
}

.person-form__dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 0 0.25rem;
  border-top: 1px solid #e5e7eb;
  margin-top: 0.5rem;
}

.app-entity-form__field-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.app-entity-form__field-row [data-searchable-select] {
  flex: 1 1 16rem;
  min-width: 12rem;
}

.app-entity-form__style-discipline-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

@container crud-detail (min-width: 520px) {
  .app-entity-form__style-discipline-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Licence form: keep sections stacked (heights differ) and tighten vertical rhythm. */
.app-licence-form .app-entity-form__body {
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.app-licence-form .app-form-section {
  padding: 0.85rem 1rem;
}

.app-licence-form .app-form-section__title {
  margin: 0 0 0.65rem;
}

@container crud-detail (min-width: 640px) {
  .crud-layout--fullscreen .app-licence-form .app-entity-form__body,
  .crud-layout--split .app-licence-form .app-entity-form__body {
    grid-template-columns: 1fr;
  }
}

/* Standalone account / settings forms (outside CRUD split layout) */
.app-account-page {
  max-width: 760px;
}

.app-account-page__intro {
  margin-bottom: 1rem;
}

.app-account-page__title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: #111827;
}

.app-account-page__sections {
  display: grid;
  gap: 1rem;
}

.app-entity-form--standalone {
  border: 1px solid var(--app-line, rgba(229, 231, 235, 0.5));
  border-radius: 14px;
  background: var(--app-glass, rgba(255, 255, 255, 0.3));
  -webkit-backdrop-filter: blur(var(--app-glass-blur, 6px));
  backdrop-filter: blur(var(--app-glass-blur, 6px));
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.03);
  overflow: hidden;
}

.app-entity-form--standalone .app-entity-form__body {
  padding: 0 1rem 1rem;
}

.app-entity-form--standalone .app-form-section {
  border: 0;
  box-shadow: none;
  padding: 0.85rem 0 0;
  background: transparent;
}

.app-entity-form__checkbox-label {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 0.875rem;
  line-height: 1.45;
  cursor: pointer;
}

.app-entity-form__checkbox-label input {
  margin-top: 0.15rem;
}

.app-account-page__error {
  color: #b91c1c;
  font-weight: 600;
}

/* Club deletion impact confirmation */
.app-crud-delete-impact-dialog {
  border: none;
  padding: 0;
  max-width: min(36rem, calc(100vw - 2rem));
  width: 100%;
  border-radius: 0.75rem;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
  background: transparent;
}

.app-crud-delete-impact-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.app-crud-delete-impact-dialog__panel {
  margin: 0;
  padding: 1.25rem 1.35rem 1.1rem;
  background: #fff;
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.app-crud-delete-impact-dialog__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
}

.app-crud-delete-impact-dialog__body {
  max-height: min(50vh, 22rem);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.app-crud-delete-impact-dialog__club h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: #1f2937;
}

.app-crud-delete-impact-dialog__subtitle {
  margin: 0 0 0.35rem;
  color: #4b5563;
  font-size: 0.92rem;
}

.app-crud-delete-impact-dialog__list {
  margin: 0;
  padding-left: 1.15rem;
  color: #111827;
}

.app-crud-delete-impact-dialog__list li {
  margin: 0.2rem 0;
}

.app-crud-delete-impact-dialog__empty {
  margin: 0;
  color: #6b7280;
  font-style: italic;
}

.app-crud-delete-impact-dialog__warning {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 0.55rem;
  border: 2px solid #b91c1c;
  background: #fef2f2;
  color: #7f1d1d;
  font-size: 0.98rem;
  line-height: 1.45;
}

.app-crud-delete-impact-dialog__warning strong {
  display: inline-block;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.app-crud-delete-impact-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}
