/* =========================================================
   Respiratom — interface d'administration
   Reprend les tokens du site public, avec une mise en page
   dense adaptée à la gestion des stages et des réservations.
   ========================================================= */

.admin-body { background: var(--mist); min-height: 100vh; }

/* Barre latérale + contenu */
.admin-shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }

.admin-side {
  background: var(--ink); color: #c3cbec; padding: 1.5rem 1.1rem 2.5rem;
  display: flex; flex-direction: column; gap: 1.75rem; position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
}
.admin-side__brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; }
.admin-side__brand img { width: 40px; height: 40px; }
.admin-side__brand span { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; }
.admin-side__brand small { display: block; font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; color: #8f9bd4; font-weight: 500; }

.admin-nav { display: grid; gap: .2rem; }
.admin-nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .8rem; border-radius: 10px; color: #c3cbec; text-decoration: none;
  font-size: .93rem; transition: background-color .15s ease, color .15s ease;
}
.admin-nav a span:first-of-type { margin-right: auto; }
.admin-nav a .icon { opacity: .75; flex-shrink: 0; }
.admin-nav a.is-active .icon { opacity: 1; }
.admin-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.admin-nav a.is-active { background: var(--brand); color: #fff; font-weight: 600; }
.admin-nav__count {
  background: rgba(255,255,255,.16); border-radius: 999px; padding: .05rem .45rem;
  font-size: .74rem; font-weight: 600;
}

.admin-side__foot { margin-top: auto; font-size: .82rem; color: #8f9bd4; display: grid; gap: .5rem; }
.admin-side__foot a { color: #c3cbec; display: inline-flex; align-items: center; gap: .35rem; }

/* min-width: 0 — sans quoi la colonne de grille refuse de passer sous la
   largeur minimale du tableau, et c'est la page entière qui déborde. */
.admin-main { padding: clamp(1.25rem, 3vw, 2.25rem); max-width: 1400px; min-width: 0; }

.admin-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.75rem;
}
.admin-head h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0; }
.admin-head p { color: var(--muted); margin: .35rem 0 0; font-size: .95rem; }

/* Cartes de statistiques */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 1.15rem 1.3rem;
}
.stat__value { font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: var(--ink); line-height: 1; letter-spacing: -.03em; }
.stat__label { font-size: .85rem; color: var(--muted); margin-top: .4rem; }

/* Panneaux et tableaux */
.admin-panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; margin-bottom: 1.75rem; min-width: 0;
}
.admin-panel__head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem;
  padding: 1rem 1.3rem; border-bottom: 1px solid var(--line); background: #fbfcff;
}
.admin-panel__head h2 { margin: 0; font-size: 1.05rem; }
.admin-panel__body { padding: 1.3rem; }

/* Le tableau défile dans son panneau au lieu de pousser la page. */
.admin-scroll { overflow-x: auto; }

.admin-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.admin-table th {
  text-align: left; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: .8rem 1rem; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-table th:first-child, .admin-table td:first-child { padding-left: 1.3rem; }
.admin-table th:last-child, .admin-table td:last-child { padding-right: 1.3rem; }
.admin-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover td { background: #fafbff; }
.admin-table__title { font-weight: 600; color: var(--ink); }
.admin-table__title a { color: inherit; text-decoration: none; }
.admin-table__title a:hover { color: var(--brand); }
.admin-table__sub { color: var(--muted); font-size: .84rem; margin-top: .15rem; }
.admin-table__actions-cell { text-align: right; }
.admin-table__actions {
  display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap;
  min-width: 196px;  /* deux boutons par ligne plutôt qu'un seul */
}
.admin-table--empty { padding: 2.5rem 1.3rem; text-align: center; color: var(--muted); }

/* Boutons compacts */
.btn-sm {
  display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .75rem;
  border-radius: 8px; border: 1px solid var(--line); background: var(--paper);
  font: inherit; font-size: .84rem; font-weight: 600; color: var(--ink-soft);
  text-decoration: none; cursor: pointer; transition: all .15s ease;
}
.btn-sm:hover { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-light); }
.btn-sm--primary { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.btn-sm--primary:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-sm--primary .icon { opacity: 1; }
.btn-sm__count { min-width: 1.4rem; padding: .05rem .4rem; border-radius: 999px; background: rgba(255,255,255,.22); font-size: .75rem; text-align: center; }
.btn-sm--danger:hover { border-color: #c0392b; color: #c0392b; background: #fdecea; }
.btn-sm--icon { padding: .38rem .55rem; line-height: 0; }
.btn-sm .icon { flex-shrink: 0; opacity: .8; }

.inline-form { display: inline; }

/* Compteur +/- */
.counter { display: inline-flex; align-items: center; gap: .3rem; }
.counter__value { min-width: 2.6rem; text-align: center; font-weight: 700; color: var(--ink); }

/* Jauge de remplissage */
.fill { display: flex; align-items: center; gap: .6rem; min-width: 150px; }
.fill__bar { flex: 1; height: 6px; border-radius: 999px; background: var(--mist-deep); overflow: hidden; }
.fill__value { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-deep)); }
.fill--low .fill__value { background: linear-gradient(90deg, var(--sky), #2f6fd8); }
.fill--full .fill__value { background: var(--muted); }
.fill__text { font-size: .82rem; color: var(--muted); white-space: nowrap; }

/* Badges de statut */
.badge {
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem; border-radius: 999px;
  font-size: .75rem; font-weight: 700; letter-spacing: .02em;
}
.badge--ok { background: #e3f6ea; color: #1c6b3f; }
.badge--wait { background: #fff3e0; color: #97591a; }
.badge--off { background: #f0f1f6; color: #6b76a0; }
.badge--live { background: var(--brand-light); color: var(--brand-deep); }

/* Formulaires admin */
.admin-form { display: grid; gap: 1.1rem; }
.admin-form .form-row label { font-size: .85rem; }
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.admin-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.admin-form .help { font-size: .8rem; }
.admin-actions { display: flex; gap: .7rem; flex-wrap: wrap; padding-top: .5rem; }

.fieldset-title {
  font-family: var(--font-display); font-weight: 800; font-size: .78rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brand); margin: 1.5rem 0 .25rem;
}
.fieldset-title:first-child { margin-top: 0; }

/* Page de connexion */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 2rem 1.25rem; background: var(--mist); }
.login-card {
  width: min(420px, 100%); background: var(--paper); border: 1px solid var(--line);
  border-radius: 22px; padding: clamp(1.75rem, 4vw, 2.5rem); box-shadow: var(--shadow-m); text-align: center;
}
.login-card img { width: 76px; height: 76px; margin: 0 auto 1rem; }
.login-card h1 { font-size: 1.5rem; margin-bottom: .3rem; }
.login-card p.sub { color: var(--muted); font-size: .92rem; margin-bottom: 1.75rem; }
.login-card .form-row { text-align: left; margin-bottom: 1rem; }
.login-card .btn { width: 100%; margin-top: .5rem; }
.login-error {
  background: #fdecea; border: 1px solid #f3c4bd; color: #a33224;
  border-radius: 12px; padding: .8rem 1rem; font-size: .9rem; margin-bottom: 1.25rem; text-align: left;
}
.login-back { display: block; margin-top: 1.5rem; font-size: .88rem; color: var(--muted); }

/* Filtre du haut de panneau */
.admin-panel__head select { width: auto; max-width: 340px; }

/* Réservations d'un stage : fiche du stage, places, inscription rapide */
.admin-back { display: inline-block; font-size: .85rem; font-weight: 600; color: var(--muted); text-decoration: none; margin-bottom: .4rem; }
.admin-back:hover { color: var(--brand-deep); }

.stage-sheet { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 1.25rem; margin-bottom: 1.75rem; }
.stage-sheet .admin-panel { margin-bottom: 0; }
.stage-sheet__info { display: flex; gap: 1.4rem; padding: 1.4rem; align-items: flex-start; }
.stage-sheet__date {
  flex-shrink: 0; width: 92px; padding: .9rem .5rem; border-radius: 14px; text-align: center;
  background: linear-gradient(150deg, var(--brand), var(--brand-deep)); color: #fff;
}
.stage-sheet__day { display: block; font-family: var(--font-display); font-weight: 800; font-size: 2.3rem; line-height: 1; }
.stage-sheet__month { display: block; margin-top: .35rem; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.stage-sheet__body { min-width: 0; }
.stage-sheet__badges { display: flex; gap: .4rem; flex-wrap: wrap; }
.stage-sheet__title { margin: .55rem 0 .7rem; font-size: clamp(1.25rem, 2.2vw, 1.55rem); }
.stage-sheet__meta { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; color: var(--ink-soft); font-size: .92rem; }
.stage-sheet__meta li { display: flex; align-items: center; gap: .5rem; }
.stage-sheet__meta .icon { color: var(--brand); }
.stage-sheet__links { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.1rem; }

.stage-sheet__seats { padding: 1.4rem; display: grid; gap: 1rem; align-content: start; }
.seats-big { display: flex; align-items: baseline; gap: .6rem; }
.seats-big__value { font-family: var(--font-display); font-weight: 800; font-size: 3.2rem; line-height: 1; letter-spacing: -.04em; color: var(--brand-deep); }
.seats-big__label { font-weight: 600; color: var(--ink-soft); }
.seats-big--low .seats-big__value { color: #2f6fd8; }
.seats-big--full .seats-big__value { color: var(--muted); }
.stage-sheet__seats .fill { min-width: 0; }
.seats-capacity { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); font-size: .9rem; color: var(--ink-soft); font-weight: 600; }
.seats-stats { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.seats-stats div { background: var(--mist); border-radius: 10px; padding: .6rem .75rem; }
.seats-stats dt { font-size: .76rem; color: var(--muted); }
.seats-stats dd { margin: .15rem 0 0; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.seats-stats__wide { grid-column: 1 / -1; }
.seats-stats small { font-family: var(--font-body); font-weight: 500; font-size: .75rem; color: var(--muted); }

.admin-section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.admin-section-head h2 { margin: 0; font-size: 1.15rem; }
.stage-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.1rem; margin-bottom: 1.75rem; }
.stage-tile {
  display: grid; grid-template-columns: auto 1fr; gap: .4rem 1.1rem; padding: 1.2rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  color: inherit; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.stage-tile:hover, .stage-tile:focus-visible { transform: translateY(-3px); border-color: #c9d1ff; box-shadow: 0 10px 28px rgba(58,75,196,.12); }
.stage-tile__date {
  width: 74px; padding: .7rem .4rem; border-radius: 12px; text-align: center; align-self: start;
  background: linear-gradient(150deg, var(--brand), var(--brand-deep)); color: #fff;
}
.stage-tile__date .stage-sheet__day { font-size: 1.8rem; }
.stage-tile__date .stage-sheet__month { font-size: .68rem; }
.stage-tile__body { display: grid; gap: .45rem; min-width: 0; }
.stage-tile__title { font-family: var(--font-display); font-weight: 800; font-size: 1.02rem; color: var(--ink); line-height: 1.3; }
.stage-tile__meta { font-size: .84rem; color: var(--muted); }
.stage-tile__seats { font-size: .88rem; color: var(--ink-soft); }
.stage-tile__seats strong { font-family: var(--font-display); font-size: 1.35rem; color: var(--brand-deep); margin-right: .15rem; }
.stage-tile__seats.is-low strong { color: #2f6fd8; }
.stage-tile__seats.is-full strong { color: var(--muted); }
.stage-tile .fill { min-width: 0; }
.stage-tile__cta { grid-column: 1 / -1; margin-top: .4rem; padding-top: .75rem; border-top: 1px solid var(--line); font-size: .86rem; font-weight: 700; color: var(--brand-deep); }
.stage-tile:hover .stage-tile__cta { text-decoration: underline; }

.quick-add { border-color: #c9d1ff; box-shadow: 0 6px 24px rgba(58,75,196,.08); }
.quick-add .admin-panel__head { background: var(--brand-light); }
.quick-add .admin-panel__head h2 { display: flex; align-items: center; gap: .45rem; color: var(--brand-deep); }
.quick-add__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.1rem; }
.quick-add__full { margin: 0; color: var(--ink-soft); }
.admin-table tr.is-cancelled td { opacity: .55; }

@media (max-width: 900px) {
  .stage-sheet { grid-template-columns: 1fr; }
  .quick-add__grid { grid-template-columns: 1fr 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 1rem; }
  .admin-nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .admin-side__foot { margin: 0; }
  .admin-grid-2, .admin-grid-3 { grid-template-columns: 1fr; }
  .admin-table { font-size: .88rem; }
}

@media (max-width: 560px) {
  .quick-add__grid { grid-template-columns: 1fr; }
  .stage-sheet__info { flex-direction: column; }
}
