/* ------------------------------------------------------------------
   Borne de salle de reunion.
   Concue pour une tablette 8,7" en paysage (1340 x 800), lue a 2-3 metres.
   Les tailles sont en clamp() pour rester correctes de 7" a 13".
------------------------------------------------------------------- */

:root {
  --ink: #f4f6f8;
  --ink-dim: rgba(244, 246, 248, 0.72);
  --ink-faint: rgba(244, 246, 248, 0.46);
  --side: rgba(0, 0, 0, 0.24);
  --line: rgba(255, 255, 255, 0.14);
  --radius: 14px;
  --banner-h: 2.1rem;

  --bg: #16191d;
  --accent: #6b7280;

  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Etats. Des couleurs profondes plutot que vives : lisibles de loin,
   sans eblouir dans un couloir sombre. */
body[data-status="free"] {
  --bg: #0c5f36;
  --accent: #3ddc84;
}
body[data-status="busy"] {
  --bg: #8a1b23;
  --accent: #ff8a8a;
}
body[data-status="pending"] {
  --bg: #8a5a08;
  --accent: #ffc861;
}
body[data-status="loading"],
body[data-status="error"] {
  --bg: #16191d;
  --accent: #9aa4b2;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  transition: background-color 600ms ease;
  user-select: none;
  -webkit-user-select: none;
}

/* ---------------------------- Bandeau ---------------------------- */

.banner {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  height: var(--banner-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  background: #1f2937;
  color: #fbbf24;
  border-bottom: 1px solid var(--line);
}

/* Le bandeau est en position fixe : la mise en page doit lui ceder la place,
   sinon il recouvre le haut du planning. */
body.has-banner {
  padding-top: var(--banner-h);
}

/* ---------------------------- Mise en page ---------------------------- */

.board {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  height: 100%;
}

.panel-main {
  display: flex;
  flex-direction: column;
  padding: clamp(1.1rem, 3vw, 2.2rem);
  min-width: 0;
}

.panel-side {
  display: flex;
  flex-direction: column;
  padding: clamp(1rem, 2.2vw, 1.6rem);
  background: var(--side);
  border-left: 1px solid var(--line);
  min-width: 0;
}

/* ---------------------------- En-tete ---------------------------- */

.room-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.room-name {
  margin: 0;
  font-size: clamp(1.5rem, 3.6vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.room-meta {
  margin: 0.25rem 0 0;
  font-size: clamp(0.78rem, 1.5vw, 0.95rem);
  color: var(--ink-dim);
}

.clock {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  line-height: 1;
}

/* ---------------------------- Statut ---------------------------- */

.status {
  margin-top: auto;
  padding-top: 1rem;
}

.status-label {
  margin: 0;
  font-size: clamp(2.6rem, 8.5vw, 5.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 0.98;
}

.status-detail {
  margin: 0.4rem 0 0;
  font-size: clamp(1rem, 2.4vw, 1.5rem);
  color: var(--ink-dim);
  font-weight: 400;
}

.progress {
  margin-top: 0.9rem;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width 1s linear;
}

/* ---------------------------- Reunion en cours ---------------------------- */

.current {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.current-subject {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-organizer {
  margin: 0.15rem 0 0;
  font-size: clamp(0.82rem, 1.7vw, 1rem);
  color: var(--ink-dim);
}

/* ---------------------------- Actions ---------------------------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.3rem;
}

.btn {
  flex: 1 1 auto;
  min-width: 140px;
  min-height: 68px;
  padding: 0.9rem 1.2rem;
  font-family: inherit;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 120ms ease, background-color 160ms ease;
}

.btn:active {
  transform: scale(0.975);
  background: rgba(255, 255, 255, 0.2);
}

.btn--primary {
  background: rgba(255, 255, 255, 0.95);
  color: #14181c;
  border-color: transparent;
}

.btn--primary:active {
  background: #fff;
}

.btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

/* ---------------------------- Planning ---------------------------- */

.side-title {
  margin: 0 0 0.8rem;
  font-size: clamp(0.72rem, 1.4vw, 0.85rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

.schedule {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.slot {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  padding: 0.62rem 0;
  border-bottom: 1px solid var(--line);
}

.slot:last-child {
  border-bottom: 0;
}

.slot--past {
  opacity: 0.4;
}

.slot--now .slot-time {
  color: var(--accent);
  font-weight: 700;
}

.slot-time {
  font-size: clamp(0.78rem, 1.5vw, 0.92rem);
  font-variant-numeric: tabular-nums;
  color: var(--ink-dim);
  white-space: nowrap;
  padding-top: 0.1rem;
}

.slot-body {
  min-width: 0;
}

.slot-subject {
  font-size: clamp(0.85rem, 1.7vw, 1rem);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-organizer {
  font-size: clamp(0.72rem, 1.4vw, 0.84rem);
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-tag {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0.1rem 0.42rem;
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-faint);
}

.side-empty {
  color: var(--ink-faint);
  font-size: 0.9rem;
  margin: 0;
}

.side-foot {
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
  margin-top: 0.7rem;
}

.sync {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}

/* ---------------------------- Feuille d'action ---------------------------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(6, 8, 10, 0.72);
  backdrop-filter: blur(3px);
}

.sheet[hidden] {
  display: none;
}

.sheet-card {
  width: min(680px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: #1b1f24;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
}

.sheet-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.sheet-close {
  width: 46px;
  height: 46px;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink-dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.sheet-body {
  padding: 1.1rem 1.2rem;
  overflow-y: auto;
}

.step + .step {
  margin-top: 1.3rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--line);
}

.step-label {
  margin: 0 0 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.step-optional {
  margin-left: 0.4rem;
  padding: 0.08rem 0.42rem;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-faint);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* Participants deja ajoutes : une pastille par personne, avec sa croix.
   La zone tactile de suppression fait 44 px pour rester atteignable
   au doigt sur une tablette murale. */
.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.7rem;
  padding: 0;
}

.tags:empty {
  display: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.35rem 0.35rem 0.85rem;
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.tag-remove {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--ink-dim);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.tag-remove:active {
  background: rgba(255, 255, 255, 0.16);
  color: var(--ink);
}

.chip {
  min-width: 96px;
  min-height: 62px;
  padding: 0.7rem 1.1rem;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  background: #f4f6f8;
  color: #14181c;
  border-color: transparent;
}

.chip[disabled] {
  opacity: 0.32;
  pointer-events: none;
}

.search {
  width: 100%;
  min-height: 62px;
  padding: 0.8rem 1rem;
  font-family: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.search:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.results {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
}

.result {
  width: 100%;
  min-height: 62px;
  padding: 0.7rem 0.9rem;
  text-align: left;
  font-family: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.results li + li {
  margin-top: 0.45rem;
}

.result:active {
  background: rgba(255, 255, 255, 0.12);
}

.result-name {
  font-size: 1rem;
  font-weight: 600;
}

.result-detail {
  font-size: 0.82rem;
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hint {
  margin: 0.6rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

.sheet-foot {
  padding: 0.9rem 1.2rem 1.1rem;
  border-top: 1px solid var(--line);
}

.sheet-summary {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-dim);
}

.sheet-buttons {
  display: flex;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.sheet-buttons .btn {
  min-height: 62px;
}

.sheet-error {
  margin: 0 0 0.5rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  color: #fecaca;
  background: rgba(153, 27, 27, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 10px;
}

/* ---------------------------- Toast ---------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.6rem;
  transform: translateX(-50%);
  z-index: 60;
  padding: 0.85rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  color: #14181c;
  background: #f4f6f8;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.toast[hidden] {
  display: none;
}

/* ---------------------------- Portrait / petits ecrans ---------------------------- */

@media (max-aspect-ratio: 1/1) {
  .board {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1.15fr) minmax(0, 1fr);
  }

  .panel-side {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .status-label {
    font-size: clamp(2.4rem, 13vw, 4.4rem);
  }
}

/* Accueil (choix de la salle) */

.picker {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 2rem;
  text-align: center;
}

.picker h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
}

.picker p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.95rem;
  max-width: 46ch;
}

.picker-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

.picker-links a {
  min-width: 200px;
  padding: 1.1rem 1.4rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
