:root {
  --brand-navy: #0c365b;
  --brand-navy-deep: #08253e;
  --brand-blue: #1f78c8;
  --brand-blue-soft: #d7ebff;
  --brand-gold: #d4a94d;
  --bg: #edf3f8;
  --surface: #ffffff;
  --surface-alt: #f6fbff;
  --ink: #14202c;
  --muted: #5b6978;
  --line: #c8d6e3;
  --success: #1e6d46;
  --success-soft: #e0f2e7;
  --warning: #8f5f0c;
  --warning-soft: #f9eed4;
  --danger: #a63732;
  --danger-soft: #f9e2e0;
  --shadow: 0 18px 44px rgba(8, 37, 62, 0.10);
  --radius: 22px;
  --radius-sm: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(31, 120, 200, 0.18), transparent 26%),
    linear-gradient(180deg, #eff5fb 0%, #e6eff8 44%, #f7fafc 100%);
  color: var(--ink);
}

a {
  color: var(--brand-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-weight: 700;
  letter-spacing: 0.01em;
}

p {
  margin: 0;
}

.app-shell {
  min-height: 100vh;
}

.site-header {
  padding: 1rem 1rem 0;
  background:
    linear-gradient(135deg, rgba(8, 37, 62, 0.98), rgba(12, 54, 91, 0.96));
  border-bottom: 1px solid rgba(212, 169, 77, 0.28);
  box-shadow: 0 12px 36px rgba(8, 37, 62, 0.22);
}

.site-header__toggle {
  display: none;
}

.site-header__panel {
  display: block;
}

.site-header__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.brand-panel,
.header-meta {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 0.9rem 1rem;
}

.brand-panel {
  display: grid;
  gap: 0.3rem;
}

.eyebrow,
.context-label,
.page-kicker,
.section-kicker {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow {
  color: rgba(255, 255, 255, 0.72);
}

.brand {
  color: #fff;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1.1;
  display: inline-block;
}

.brand:hover {
  text-decoration: none;
}

.brand-subtitle,
.meta {
  color: rgba(255, 255, 255, 0.80);
}

.header-meta {
  min-width: 15rem;
  display: grid;
  gap: 0.35rem;
  justify-items: end;
  text-align: right;
}

.context-label {
  color: var(--brand-gold);
}

.nav {
  max-width: 1120px;
  margin: 0.9rem auto 0;
  padding: 0 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 700;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.nav-link:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.16);
}

.nav-link.is-current {
  background: #fff;
  border-color: #fff;
  color: var(--brand-navy);
}

.nav-link--quiet {
  border-style: dashed;
}

.page-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.35rem 0 3rem;
}

.stack {
  display: grid;
  gap: 1rem;
}

.stack-lg {
  display: grid;
  gap: 1.5rem;
}

.card,
.message,
form,
.table-wrap {
  border-radius: var(--radius);
}

.card,
.surface-card,
.table-wrap {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(12, 54, 91, 0.12);
  box-shadow: var(--shadow);
}

.card,
.surface-card {
  padding: 1.2rem;
}

.page-intro {
  background:
    linear-gradient(135deg, rgba(12, 54, 91, 0.98), rgba(31, 120, 200, 0.92));
  color: #fff;
  overflow: hidden;
}

.page-intro .page-kicker,
.page-intro .page-lead,
.page-intro .meta-list,
.page-intro .meta-list a {
  color: rgba(255, 255, 255, 0.86);
}

.page-intro .page-kicker {
  color: rgba(255, 255, 255, 0.72);
}

.page-title {
  margin-top: 0.35rem;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
}

.page-lead {
  margin-top: 0.75rem;
  line-height: 1.6;
  max-width: 60ch;
}

.meta-list {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.meta-pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.meta-pill {
  background: rgba(255, 255, 255, 0.14);
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.slot-card {
  display: grid;
  gap: 1rem;
}

.slot-card__actions,
.table-actions,
.slot-edit-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.slot-card--admin {
  border-style: dashed;
}

.slot-edit-grid label {
  display: grid;
  gap: 0.35rem;
  min-width: 8rem;
}

.helper-copy {
  color: var(--muted);
  line-height: 1.5;
}

.responsable-slot-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.responsable-slot form {
  margin: 0;
}

.responsable-pill {
  width: 100%;
  min-height: 3rem;
  border: 1px solid transparent;
  border-radius: 16px;
  font-weight: 800;
  padding: 0.8rem 0.9rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.2rem;
}

.responsable-pill strong,
.responsable-pill small {
  display: block;
}

.responsable-pill small {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}

.responsable-pill__action {
  font-weight: 800;
  letter-spacing: 0.01em;
  opacity: 0.9;
}

.responsable-pill.is-open {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(166, 55, 50, 0.25);
}

.responsable-pill.is-taken {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(30, 109, 70, 0.22);
}

.responsable-pill.is-mine {
  background: var(--warning-soft);
  color: var(--brand-navy);
  border-color: rgba(143, 95, 12, 0.22);
}

.responsable-pill.is-cancelled {
  width: 100%;
  min-height: 3rem;
  background: #eef1f5;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
}

.section-heading h2 {
  font-size: 1.45rem;
}

.section-note {
  color: var(--muted);
  line-height: 1.55;
}

.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.session-card,
.metric-card,
.table-card,
.form-card,
.empty-state,
.timeline-card {
  display: grid;
  gap: 1rem;
}

.session-card.is-cancelled {
  border-color: rgba(166, 55, 50, 0.32);
  background: linear-gradient(135deg, rgba(249, 226, 224, 0.96), #fff);
}

.session-meta,
.actions,
.inline-form,
.control-cluster,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.session-card__title,
.item-title {
  font-size: 1.45rem;
}

.session-card__title a,
.item-title a {
  color: var(--brand-navy);
}

.session-card__title a:hover,
.item-title a:hover {
  color: var(--brand-blue);
  text-decoration: none;
}

.session-summary,
.detail-copy,
.empty-state p,
.timeline-card p {
  color: var(--muted);
  line-height: 1.6;
}

.detail-list,
.key-stats {
  display: grid;
  gap: 0.8rem;
}

.key-stats {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.stat-card {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

.stat-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.15rem;
  color: var(--brand-navy);
}

.info-list {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.badge {
  background: var(--brand-blue-soft);
  border-color: rgba(31, 120, 200, 0.14);
  color: var(--brand-navy);
}

.badge.status-open,
.badge.status-success {
  background: var(--success-soft);
  border-color: rgba(30, 109, 70, 0.18);
  color: var(--success);
}

.badge.status-closed,
.badge.status-warning,
.badge.status-completed {
  background: var(--warning-soft);
  border-color: rgba(143, 95, 12, 0.18);
  color: var(--warning);
}

.badge.status-cancelled,
.badge.status-danger,
.badge.is-danger {
  background: var(--danger-soft);
  border-color: rgba(166, 55, 50, 0.18);
  color: var(--danger);
}

.badge.status-neutral {
  background: #eef3f7;
  border-color: rgba(20, 32, 44, 0.10);
  color: var(--muted);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.76rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-navy));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(31, 120, 200, 0.22);
}

.button-icon {
  width: 2.8rem;
  padding-inline: 0;
  font-size: 1.35rem;
  line-height: 1;
}

.button-compact {
  padding-inline: 0.9rem;
  min-height: 2.8rem;
  white-space: nowrap;
}

button:hover,
.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

button.secondary,
.button.secondary {
  background: #edf4fb;
  color: var(--brand-navy);
  box-shadow: none;
  border: 1px solid rgba(12, 54, 91, 0.14);
}

button.success,
.button.success {
  background: var(--success);
  color: #fff;
}

button.danger,
.button.danger {
  background: linear-gradient(135deg, #b4443e, var(--danger));
}

.button.ghost {
  background: transparent;
  color: var(--brand-blue);
  border: 1px solid rgba(31, 120, 200, 0.28);
  box-shadow: none;
}

form {
  display: grid;
  gap: 1rem;
}

.form-body {
  display: grid;
  gap: 0.85rem;
}

.form-body p,
form > p {
  display: grid;
  gap: 0.4rem;
  margin: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.78rem 0.9rem;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

input[type="checkbox"] {
  width: auto;
  min-height: auto;
  padding: 0;
}

input:focus,
select:focus,
textarea:focus,
button:focus,
.button:focus,
a:focus {
  outline: 3px solid rgba(31, 120, 200, 0.22);
  outline-offset: 2px;
}

label {
  display: grid;
  gap: 0.4rem;
  font-weight: 700;
}

.inline-form {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.inline-form select,
.inline-form input {
  flex: 1 1 11rem;
  min-width: 0;
}

.messages {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.message {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(12, 54, 91, 0.10);
  background: var(--surface);
}

.message-label {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--brand-blue-soft);
  color: var(--brand-navy);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message.success .message-label,
.message.success {
  background: var(--success-soft);
  border-color: rgba(30, 109, 70, 0.16);
}

.message.error .message-label,
.message.error {
  background: var(--danger-soft);
  border-color: rgba(166, 55, 50, 0.18);
}

.message.error {
  color: #5d241f;
}

.message.success {
  color: #174d34;
}

ul.errorlist {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--danger);
  font-weight: 700;
}

.table-wrap {
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table thead th {
  background: #eef5fb;
  color: var(--brand-navy);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

/* Stacked tables (used for mobile and compact desktop views) */
.table.table-stack thead {
  display: none;
}

.table.table-stack,
.table.table-stack tbody,
.table.table-stack tr,
.table.table-stack td {
  display: block;
  width: 100%;
}

.table.table-stack tr {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
}

.table.table-stack td {
  padding: 0.4rem 0;
  border: 0;
}

.table.table-stack td::before {
  content: attr(data-label);
  display: block;
  margin-bottom: 0.15rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Expandable rows */
.table-stack--expandable tr {
  cursor: pointer;
  position: relative;
  padding-right: 3rem; /* Space for the indicator */
  transition: background-color 120ms ease;
}

.table-stack--expandable tr:active {
  background-color: rgba(31, 120, 200, 0.05);
}

/* Summary line: show first 3 columns together without labels */
.table-stack--expandable tr td:nth-child(-n+3) {
  display: inline-block;
  width: auto;
  margin-right: 0.5rem;
  padding: 0;
  vertical-align: middle;
}

.table-stack--expandable tr td:nth-child(-n+3)::before {
  display: none;
}

/* Make first column a bit more prominent in summary */
.table-stack--expandable tr td:first-child {
  font-weight: 700;
  color: var(--brand-navy);
}

/* Hide columns from 4th onwards when collapsed */
.table-stack--expandable tr td:nth-child(n+4) {
  display: none;
}

/* Show all columns and restore standard block layout when expanded */
.table-stack--expandable tr.is-expanded td {
  display: block;
  width: 100%;
  padding: 0.4rem 0;
}

.table-stack--expandable tr.is-expanded td::before {
  display: block;
}

.table-stack--expandable tr.is-expanded td:nth-child(-n+3)::before {
  display: block;
}

.table-stack--expandable tr::after {
  content: "";
  position: absolute;
  top: 1.4rem;
  right: 1.2rem;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--brand-blue);
  border-bottom: 2px solid var(--brand-blue);
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.table-stack--expandable tr.is-expanded::after {
  transform: rotate(-135deg) translateY(-2px) translateX(-2px);
}

.table-stack--expandable tr.is-expanded {
  padding-bottom: 1.2rem;
  background-color: rgba(31, 120, 200, 0.02);
}

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

.timeline {
  display: grid;
  gap: 0.9rem;
}

.timeline-card {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

.timeline-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: space-between;
}

.timeline-card__details {
  display: grid;
  gap: 0.45rem;
}

.auth-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.9fr);
}

.auth-aside {
  display: grid;
  gap: 1rem;
}

.empty-state {
  text-align: left;
}

.helper-copy {
  color: var(--muted);
  line-height: 1.55;
}

.calendar-shell,
.calendar-detail {
  display: grid;
  gap: 1rem;
}

.calendar-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.calendar-toolbar .actions {
  gap: 0.5rem;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  padding: 0.5rem 1rem;
  background: rgba(12, 54, 91, 0.04);
  border: 1px solid rgba(12, 54, 91, 0.08);
  border-radius: 14px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-navy);
  white-space: nowrap;
}

.calendar-toolbar .calendar-legend {
  justify-content: flex-start;
}

@media (max-width: 480px) {
  /* Gagne de la place au-dessus du calendrier sur téléphone */
  .calendar-legend {
    flex-wrap: wrap;
    padding: 0.35rem 0.6rem;
    gap: 0.6rem;
  }

  .legend-item {
    font-size: 0.72rem;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .calendar-toolbar {
    gap: 1rem;
  }
}

.legend-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.legend-dot.status-free-practice { background: #e0f2e7; border-color: #1e6d46; }
.legend-dot.status-course { background: #d7ebff; border-color: #1f78c8; }
.legend-dot.status-full { background: #f9e2e0; border-color: #a63732; }

.section-title {
  margin-top: 0.3rem;
  font-size: 1.55rem;
}

.calendar-grid-shell {
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.calendar-shared {
  min-width: 980px;
  display: grid;
  gap: 0.65rem;
}

.calendar-shared__header {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: end;
  gap: 0.35rem;
}

.calendar-shared__gutter {
  height: 1px;
}

.calendar-shared__dayheads {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(12, 54, 91, 0.10);
  background: rgba(255, 255, 255, 0.75);
}

.calendar-shared__dayhead {
  padding: 0.65rem 0.6rem;
  border-left: 1px solid rgba(12, 54, 91, 0.08);
}

.calendar-shared__dayhead:first-child {
  border-left: 0;
}

.calendar-shared__dayhead.is-today {
  background: rgba(31, 120, 200, 0.06);
}

.calendar-shared__dayhead-pack {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.calendar-shared__date {
  font-size: 1.55rem;
  line-height: 0.95;
  color: var(--brand-navy);
}

.calendar-shared__labels {
  display: grid;
  gap: 0.1rem;
}

.calendar-shared__weekday {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.calendar-shared__full {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.3;
}

.calendar-day__list {
  background: #ffffff;
  border: 1px solid rgba(12, 54, 91, 0.08);
  border-radius: 8px;
  margin-top: 0.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  --calendar-hour-step: 52px;
  box-shadow:
    inset 0 14px 14px -14px rgba(12, 54, 91, 0.22),
    inset 0 -14px 14px -14px rgba(12, 54, 91, 0.22);
  cursor: grab;
  user-select: none;
}

.calendar-day__list.is-dragging {
  cursor: grabbing;
}

.calendar-day__timeline {
  position: relative !important;
  background-image:
    /* demi-heures */
    repeating-linear-gradient(
      to bottom,
      rgba(12, 54, 91, 0.05) 0,
      rgba(12, 54, 91, 0.05) 1px,
      transparent 1px,
      transparent calc(var(--calendar-hour-step) / 2)
    ),
    /* heures */
    repeating-linear-gradient(
      to bottom,
      rgba(12, 54, 91, 0.10) 0,
      rgba(12, 54, 91, 0.10) 1px,
      transparent 1px,
      transparent var(--calendar-hour-step)
    );
}

.calendar-shared__body {
  border-radius: 16px;
  overflow-x: hidden;
}

.calendar-shared__timeline {
  display: grid;
  grid-template-columns: 56px 1fr;
  position: relative;
}

.calendar-shared__timeline::before {
  content: "";
  grid-column: 1;
}

.calendar-shared__days {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  background: linear-gradient(180deg, rgba(246, 251, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.calendar-shared__daycol {
  position: relative;
  border-left: 1px solid rgba(12, 54, 91, 0.06);
}

.calendar-shared__daycol:first-child {
  border-left: 0;
}

.calendar-shared__daycol.is-today {
  background: rgba(31, 120, 200, 0.04);
}

.calendar-hour-marker {
  position: absolute !important;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(12, 54, 91, 0.12) !important;
  pointer-events: none;
  z-index: 1 !important;
}

.calendar-hour-marker__label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  background: #fbfdff;
  padding: 0 4px;
  position: absolute;
  top: -0.45rem;
  left: 4px;
  line-height: 1;
}

.calendar-shared__timeline > .calendar-hour-marker {
  left: 0;
  right: 0;
  border-top-style: solid !important;
}

.calendar-shared__timeline > .calendar-hour-marker .calendar-hour-marker__label {
  left: 10px;
}

.calendar-shared__timeline > .calendar-hour-marker {
  grid-column: 1 / -1;
}

.calendar-day__empty {
  padding: 0.55rem 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.calendar-block {
  position: absolute !important;
  display: flex;
  flex-direction: column;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  border: 1px solid rgba(12, 54, 91, 0.12) !important;
  box-shadow: 0 2px 6px rgba(12, 54, 91, 0.04);
  background: #fff;
  color: var(--ink);
  overflow: hidden;
  z-index: 5 !important; /* Always above markers */
}

.calendar-block:hover {
  text-decoration: none;
  transform: translateY(-1px) scale(1.02);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(12, 54, 91, 0.12);
}

.calendar-block.is-selected {
  z-index: 5;
  box-shadow: 0 0 0 2px var(--brand-blue), 0 8px 22px rgba(12, 54, 91, 0.14);
  border-color: var(--brand-blue);
}

/* Color Coding */
.calendar-block.session-type-free_practice {
  background: #e0f2e7;
  border-color: rgba(30, 109, 70, 0.25);
}

.calendar-block.session-type-course {
  background: #d7ebff;
  border-color: rgba(31, 120, 200, 0.25);
}

.calendar-block.status-danger,
.calendar-block.status-warning {
  background: #f9e2e0;
  border-color: rgba(166, 55, 50, 0.25);
}

.calendar-block__time-minimal {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--brand-navy);
  line-height: 1.1;
  margin-bottom: 0.1rem;
}

.calendar-block__label-minimal {
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--brand-navy);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  opacity: 0.92;
}

.calendar-detail__summary {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.calendar-detail__when {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: baseline;
}

.calendar-detail__when strong {
  display: inline;
  margin-top: 0;
  font-size: 1.15rem;
}

.calendar-detail__when-date,
.calendar-detail__when-time {
  display: inline;
  white-space: nowrap; /* ne casse pas "vendredi 20 mars" ni "19h30 - 21h00" */
}

.reserve-denial {
  display: inline-block;
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  background: rgba(31, 120, 200, 0.06);
  border: 1px solid rgba(31, 120, 200, 0.18);
  color: var(--brand-navy);
  font-weight: 700;
  line-height: 1.4;
  max-width: 100%;
}

.calendar-detail__notes {
  padding: 1rem;
  border-radius: 18px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

.attendee-card {
  padding: 1rem;
}

.attendee-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.attendee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 14px;
  border: 1px solid rgba(12, 54, 91, 0.10);
  background: rgba(255, 255, 255, 0.75);
}

.attendee-name {
  font-weight: 800;
  color: var(--brand-navy);
}

.attendee-actions {
  display: inline-flex;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.attendee-toggle {
  min-height: 2.2rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
}

.attendee-toggle.is-active[data-attendance="present"] {
  background: var(--success-soft);
  border-color: rgba(30, 109, 70, 0.22);
  color: var(--success);
}

.attendee-toggle.is-active[data-attendance="absent"] {
  background: var(--danger-soft);
  border-color: rgba(166, 55, 50, 0.22);
  color: var(--danger);
}

.attendee-row[data-attendance="present"] {
  border-color: rgba(30, 109, 70, 0.22);
}

.attendee-row[data-attendance="absent"] {
  border-color: rgba(166, 55, 50, 0.22);
}

.attendee-hint {
  margin-top: 0.65rem;
}

.calendar-empty-state {
  padding: 1.1rem 0.2rem 0.1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.password-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.password-gate__shell {
  width: min(100%, 34rem);
  display: grid;
  gap: 1rem;
}

.password-gate__card {
  gap: 1.4rem;
  padding: 1.5rem;
}

.password-gate__intro {
  display: grid;
  gap: 0.75rem;
}

.password-gate__intro .page-kicker {
  color: var(--brand-blue);
}

.password-gate__intro .page-lead {
  margin-top: 0;
  max-width: none;
  color: var(--muted);
}

@media (max-width: 860px) {
  .site-header__inner,
  .auth-layout {
    grid-template-columns: 1fr;
    display: grid;
  }

  .header-meta {
    justify-items: start;
    text-align: left;
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 1rem, 100%);
    padding-top: 1rem;
  }

  .site-header {
    padding: 0.8rem 0.8rem 0.8rem;
  }

  .site-header.has-mobile-toggle .site-header__toggle {
    width: min(100%, 1120px);
    margin: 0 auto;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-align: left;
  }

  .site-header__toggle-copy {
    display: grid;
    gap: 0.18rem;
  }

  .site-header__toggle-label {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
  }

  .site-header__toggle-meta {
    color: #fff;
    font-weight: 700;
    line-height: 1.3;
  }

  .site-header__toggle-indicator {
    width: 0.9rem;
    height: 0.9rem;
    border-right: 3px solid #fff;
    border-bottom: 3px solid #fff;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 160ms ease;
    flex: 0 0 auto;
  }

  .site-header.has-mobile-toggle .site-header__panel {
    display: none;
    padding-top: 0.75rem;
  }

  .site-header.has-mobile-toggle.is-open .site-header__panel {
    display: block;
    padding-bottom: 0.8rem;
  }

  .site-header.has-mobile-toggle.is-open .site-header__toggle-indicator {
    transform: rotate(225deg) translateY(-1px);
  }

  .card,
  .surface-card,
  .table-wrap {
    border-radius: 18px;
  }

  .page-title {
    font-size: 1.9rem;
  }

  .table-actions,
  .actions,
  .inline-form {
    width: 100%;
  }

  .calendar-toolbar,
  .calendar-grid {
    min-width: 0;
  }

  .calendar-grid-shell {
    margin-inline: -0.15rem;
    padding-inline: 0.15rem;
  }

  .calendar-grid {
    min-width: 920px;
    gap: 0.55rem;
    grid-template-columns: repeat(7, minmax(118px, 1fr));
  }

  .calendar-day {
    min-height: 500px;
    padding: 0.65rem;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
  }

  .calendar-day__date {
    font-size: 1.65rem;
  }

  .calendar-block {
    padding: 0.35rem 0.4rem;
    border-radius: 8px;
  }

  .calendar-block__title {
    font-size: 0.78rem;
  }

  .actions > *,
  .card-actions > *,
  .inline-form > * {
    flex: 1 1 100%;
  }

  /* Calendrier: navigation semaine sur une seule ligne */
  .calendar-toolbar .actions {
    width: auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.45rem;
  }

  .calendar-toolbar .actions > * {
    flex: 0 0 auto;
  }

  .calendar-toolbar .button-icon {
    width: 2.45rem;
    min-height: 2.45rem;
    font-size: 1.25rem;
  }

  .calendar-toolbar .button-compact {
    min-height: 2.45rem;
    padding-inline: 0.75rem;
    font-size: 0.95rem;
  }

  /* Calendrier: échelle un peu plus compacte sur téléphone */
  .calendar-day__list {
    --calendar-hour-step: 44px;
  }
}

.status-info {
  background: var(--brand-blue-soft);
  color: var(--brand-navy);
  border-color: rgba(31, 120, 200, 0.22);
}

.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.account-create-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.account-access-form {
  gap: 0.75rem;
}

.stack-sm {
  display: grid;
  gap: 0.4rem;
}

.course-choice-grid {
  display: grid;
  gap: 0.5rem;
}

.course-choice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(246, 251, 255, 0.88);
  font-weight: 600;
}

.course-choice input[type="checkbox"] {
  margin: 0;
}

.session-type-course {
  border-color: rgba(31, 120, 200, 0.24);
  background: linear-gradient(180deg, rgba(215, 235, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.session-type-free_practice {
  border-color: rgba(30, 109, 70, 0.18);
}
