/* Planning staff — thème nocturne, aucune dépendance externe */

:root {
  --bg: #0e1116;
  --surface: #171c24;
  --surface-2: #1e2530;
  --border: #2a3341;
  --text: #e8ecf1;
  --muted: #8b95a5;
  --accent: #f5b942;

  --g: #f5b942;   /* Garde-scène */
  --c: #4cc3e8;   /* Câble */
  --p: #b48cf2;   /* Podium */
  --f: #5fd08a;   /* Fluidification & portes */
  --off: #66707f; /* Congé */

  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.45;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 16px 14px 64px; }
.wrap-large { max-width: 1400px; }

header.app {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 2px 14px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { height: 34px; width: auto; display: block; border-radius: 8px; }
header.app h1 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
  line-height: 1.15;
}
header.app h1 small {
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--muted);
}
header.app h1 span { color: var(--accent); }
.updated { color: var(--muted); font-size: 0.75rem; }

button, select, input[type="text"], input[type="password"] {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}
button { cursor: pointer; }
button:hover { border-color: var(--muted); }
button:focus-visible, select:focus-visible, input:focus-visible, .name-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
button.primary { background: var(--accent); color: #17130a; font-weight: 700; border-color: transparent; }
button.ghost { background: transparent; }
button.small { padding: 4px 10px; font-size: 0.85rem; }

/* ---- Choix du nom ---- */
.picker h2 { font-size: 1.3rem; margin: 18px 0 4px; }
.picker p { color: var(--muted); margin: 0 0 14px; }
.picker input { width: 100%; margin-bottom: 10px; }
.name-list { display: flex; flex-direction: column; gap: 6px; }
.name-item {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-weight: 600;
}
.name-item:hover { background: var(--surface-2); }

/* ---- Bandeau identité ---- */
.me {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  margin-bottom: 12px;
}
.me .who { font-weight: 700; font-size: 1.05rem; }

/* ---- Cartes soirées ---- */
.night {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  margin-bottom: 10px;
}
.night.past { opacity: 0.45; }
.night.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.night .top { display: flex; align-items: center; gap: 12px; }
.night .date { flex: 1; }
.night .date .d { font-weight: 800; font-size: 1.02rem; letter-spacing: 0.01em; }
.night .date .tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #17130a;
  background: var(--accent);
  border-radius: 999px;
  padding: 2px 8px;
  vertical-align: 2px;
}

.badge {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.15rem;
  min-width: 58px;
  text-align: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid;
}
.badge.small { font-size: 0.8rem; min-width: 0; padding: 2px 7px; border-radius: 6px; }
.fam-G { color: var(--g); border-color: var(--g); background: rgba(245, 185, 66, 0.09); }
.fam-C { color: var(--c); border-color: var(--c); background: rgba(76, 195, 232, 0.09); }
.fam-P { color: var(--p); border-color: var(--p); background: rgba(180, 140, 242, 0.09); }
.fam-F { color: var(--f); border-color: var(--f); background: rgba(95, 208, 138, 0.09); }
.fam-off { color: var(--off); border-color: var(--border); background: transparent; }

.poste-name { color: var(--muted); font-size: 0.83rem; margin-top: 2px; }

.start-chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 6px;
  vertical-align: 1px;
}
.start-chip.early {
  color: #17130a;
  background: var(--accent);
  border-color: var(--accent);
}

.note {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--accent);
  background: rgba(245, 185, 66, 0.07);
  border-left: 3px solid var(--accent);
  padding: 6px 10px;
  border-radius: 0 8px 8px 0;
}

.mates { margin-top: 10px; font-size: 0.9rem; }
.mates.family { padding-top: 8px; border-top: 1px dashed var(--border); }
.mates.family .team-grid { margin-top: 6px; }
.mates .label { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.mates ul { list-style: none; margin: 4px 0 0; padding: 0; }
.mates li { padding: 2px 0; }

details.team { margin-top: 10px; }
details.team summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.83rem;
  user-select: none;
}
details.team summary:hover { color: var(--text); }
.team-grid { margin-top: 8px; display: grid; gap: 8px; }
.team-poste { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 0.85rem; }
.team-poste .names { color: var(--muted); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 4px 0 16px;
  font-size: 0.78rem;
  color: var(--muted);
}
.legend-item {
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.legend .badge.small { cursor: default; }

.error-box {
  background: rgba(220, 80, 80, 0.12);
  border: 1px solid rgba(220, 80, 80, 0.5);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 12px 0;
}

/* ---- Admin ---- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .status { font-size: 0.85rem; color: var(--muted); }
.toolbar .status.saving { color: var(--accent); }
.toolbar .status.error { color: #e07070; }
.toolbar .status.saved { color: var(--f); }

.grid-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.grid { border-collapse: collapse; font-size: 0.82rem; min-width: 100%; }
table.grid th, table.grid td { border: 1px solid var(--border); padding: 3px; text-align: center; }
table.grid thead th {
  background: var(--surface-2);
  position: sticky; top: 0; z-index: 2;
  padding: 6px 4px;
  font-size: 0.74rem;
  white-space: nowrap;
}
table.grid tbody th {
  background: var(--surface);
  position: sticky; left: 0; z-index: 1;
  text-align: left;
  padding: 4px 8px;
  font-weight: 600;
  white-space: nowrap;
}
table.grid thead th:first-child { left: 0; z-index: 3; }
table.grid select {
  border: none;
  border-radius: 6px;
  padding: 5px 2px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.8rem;
  width: 70px;
  text-align: center;
  background: transparent;
}
table.grid select.fam-G { color: var(--g); background: rgba(245,185,66,0.10); }
table.grid select.fam-C { color: var(--c); background: rgba(76,195,232,0.10); }
table.grid select.fam-P { color: var(--p); background: rgba(180,140,242,0.10); }
table.grid select.fam-F { color: var(--f); background: rgba(95,208,138,0.10); }
table.grid select.fam-off { color: var(--off); }
table.grid select option { background: var(--surface-2); color: var(--text); }
table.grid td.flash-ok { animation: flok 0.9s; }
table.grid td.flash-err { animation: flerr 1.4s; }
@keyframes flok { 0% { background: rgba(95,208,138,0.4); } 100% { background: transparent; } }
@keyframes flerr { 0% { background: rgba(220,80,80,0.55); } 100% { background: transparent; } }

tr.notes-row input { width: 120px; font-size: 0.72rem; padding: 4px 6px; }
tr.counts-row td { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); padding: 4px 2px; white-space: pre-line; }
tr.counts-row th { font-size: 0.72rem; color: var(--muted); }

.addstaff { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ---- Vue soirées ---- */
.date-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 12px;
  scrollbar-width: thin;
}
.date-chip {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.date-chip.past { opacity: 0.5; }
.date-chip.is-today { border-color: var(--accent); }
.date-chip.on { background: var(--accent); color: #17130a; border-color: var(--accent); opacity: 1; }

.today-summary { margin-bottom: 14px; }

.roster {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.roster-title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.roster-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  padding: 5px 0;
  font-size: 0.92rem;
}
.roster-row + .roster-row { border-top: 1px dashed var(--border); }
.roster-names em { color: var(--muted); font-style: italic; }
.roster-names.muted { color: var(--muted); }
.off-title { color: var(--off); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.night { scroll-margin-top: 62px; } /* dégage la barre d’identité collante */

/* Logo fourni sur fond blanc : pastille claire sur le thème sombre */
.brand img { background: #fff; border-radius: 8px; padding: 3px 8px; }
