/* Raccord admin — même marque que l'appli : noir, papier, jaune. Une seule page, pas d'onglets. */
:root { --bg: #0B0B0C; --ink: #F2F0EC; --jaune: #FFD400; --card: #19191B; --card2: #232326; --mute: #9A9792; --line: #2A2A2D; --rouge: #FF6B5E; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); font: 500 15px/1.45 Figtree, system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: clip; }
button, input, select { font: inherit; color: inherit; }
input, select { font-size: 16px; } /* 16 px : l'iPhone ne zoome pas */
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--jaune); outline-offset: 2px; border-radius: 6px; }
.mute { color: var(--mute); }
.petit { font-size: 13px; }
#app { max-width: 1180px; margin: 0 auto; padding: 16px 16px calc(48px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 16px; }
#app > *, .duo > *, .bloc > * { min-width: 0; }

.entre { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
h1 { font-size: 22px; font-weight: 900; letter-spacing: -.03em; display: flex; align-items: center; gap: 8px; }
h1 .mute { font-weight: 600; }
.point { width: 14px; height: 14px; border-radius: 50%; background: var(--jaune); }
h2 { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.bouton { min-height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 700; }
.bouton.plein { background: var(--jaune); color: var(--bg); border: 0; min-height: 48px; }
input, select { min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); min-width: 0; }

.alerte { background: #2a1512; color: var(--rouge); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.pastille { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 10px; background: var(--card2); color: var(--mute); font: 700 11.5px/1.6 Figtree, sans-serif; white-space: nowrap; vertical-align: 1px; }
.pastille.jaune { background: var(--jaune); color: var(--bg); }
.pastille.rouge { background: #2a1512; color: var(--rouge); }

/* Tuiles */
.tuiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tuile { background: var(--card); border-radius: 14px; padding: 14px; display: grid; gap: 2px; align-content: start; }
.tuile strong { font-size: 30px; font-weight: 900; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tuile.fort strong { color: var(--jaune); }
.tuile small { font-size: 12.5px; line-height: 1.35; }
.trio .tuile { background: var(--card2); padding: 10px; }
.trio .tuile strong { font-size: 22px; }

/* Blocs */
.bloc { background: var(--card); border-radius: 14px; padding: 16px; display: grid; gap: 12px; align-content: start; }
.bloc .note { font-size: 13px; margin-top: -8px; }
.duo { display: grid; gap: 16px; }

/* La place des agents : des cases vides, en pointillés tant qu'aucun n'est branché */
.agents { display: grid; gap: 10px; }
.agent { display: grid; gap: 4px; justify-items: start; align-content: start; padding: 14px; border: 1px dashed #4a4845; border-radius: 12px; }
.agent img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; margin-bottom: 4px; }
.agent b { font-size: 16px; overflow-wrap: anywhere; }
.agent .pastille { margin: 6px 0 0; }

/* Barres par jour : 30 colonnes, la hauteur vient de --l */
.graphe { display: grid; gap: 6px; }
.barres { display: flex; align-items: flex-end; gap: 2px; height: 84px; border-bottom: 1px solid var(--line); }
.barres i { flex: 1; min-width: 0; height: max(2px, var(--l)); background: #6f6c68; border-radius: 3px 3px 0 0; }
.barres.jaune i { background: var(--jaune); }

/* Lignes à barre : parcours, options, place, partages */
.lignes { display: grid; gap: 12px; }
.ligne { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; }
.ligne .nom { font-weight: 700; overflow-wrap: anywhere; }
.ligne .val { color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.barre, .jauge { grid-column: 1 / -1; display: block; height: 6px; border-radius: 3px; background: linear-gradient(var(--jaune), var(--jaune)) 0 / var(--l) 100% no-repeat var(--card2); }

/* Les comptes */
.outils { display: grid; gap: 8px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--mute); padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 4px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr.test td { color: var(--mute); }
td:first-child { white-space: normal; } /* seule colonne qui peut passer à la ligne : le tableau tient à 768 px avec un pseudo de 24 lettres */
.pseudo { background: none; border: 0; cursor: pointer; font-weight: 800; min-height: 40px; text-align: left; overflow-wrap: anywhere; }
.pseudo:hover { color: var(--jaune); }

/* La fiche */
.fiche { margin: auto; width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--ink); padding: 18px; }
.fiche[open] { display: grid; gap: 14px; }
.fiche::backdrop { background: #000a; }
.fiche h2 { font-size: 22px; overflow-wrap: anywhere; }
.fiche .pastille { margin: 0; }
dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; }
dt { color: var(--mute); }
dd { font-weight: 700; text-align: right; }
.bascule { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--card2); cursor: pointer; }
.bascule span { display: grid; gap: 2px; }
.bascule small { font-size: 12.5px; line-height: 1.35; }
.bascule input { appearance: none; flex: none; width: 48px; height: 28px; min-height: 0; padding: 0; border: 0; border-radius: 14px; background: #4a4845; position: relative; cursor: pointer; transition: background .15s; }
.bascule input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); transition: transform .15s; }
.bascule input:checked { background: var(--jaune); }
.bascule input:checked::after { transform: translateX(20px); background: var(--bg); }

/* La porte */
.porte { max-width: 360px; width: 100%; margin: 12vh auto 0; display: grid; gap: 14px; }
.porte label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }

/* Téléphone : chaque ligne du tableau devient une fiche, chaque case porte le nom de sa colonne */
@media (max-width: 719px) {
  thead { display: none; }
  table, tbody, td { display: block; }
  tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; background: var(--card2); border-radius: 12px; padding: 6px 12px 12px; margin-bottom: 8px; }
  td { padding: 0; border: 0; white-space: normal; }
  td::before { content: attr(data-col); display: block; color: var(--mute); font-size: 12.5px; }
  td:first-child { grid-column: 1 / -1; }
  td:first-child::before { content: none; }
}
@media (min-width: 720px) {
  #app { padding: 24px 24px 56px; gap: 20px; }
  .tuiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .tuile strong { font-size: 36px; }
  .outils { grid-template-columns: minmax(0, 1fr) auto auto; }
  .barres { height: 110px; gap: 3px; }
  .agents { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  td:nth-child(n+4), th:nth-child(n+4) { text-align: right; }
}
@media (min-width: 720px) and (max-width: 1023px) { table { font-size: 14px; } th, td { padding-inline: 6px; } }
@media (min-width: 1024px) { .duo { grid-template-columns: 1fr 1fr; } }
