/* Espace administrateur : la même régie de nuit que la télécommande (web/animateur.css).
   Surfaces graphite, un vert pour ce qui est en ligne, un rouge réservé à ce qui coupe un accès. */
:root {
  --bg: #141415; --card: #19191b; --card2: #232325;
  --line: rgba(237, 237, 237, .08); --line2: rgba(237, 237, 237, .2);
  --ink: #ededed; --muted: #a1a1a6; --faint: #85858b; --on-ink: #141415;
  --ok: #4cc38a; --bad: #e5484d; --bad-ink: #ff8a8d;
  --r-ctl: 10px; --r-card: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 14px/20px 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1, h2 { margin: 0; font-weight: 600; }
h1 { font-size: 20px; line-height: 28px; }
h2 { font-size: 16px; line-height: 24px; }
p { margin: 0; }
b { font-weight: 600; }
.muted { color: var(--muted); }
.err { min-height: 20px; color: var(--bad-ink); font-weight: 500; }
.err:empty { min-height: 0; }

.btn { min-height: 36px; padding: 7px 14px; border: 1px solid var(--line2); border-radius: var(--r-ctl); background: none; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background-color .12s; }
.btn:hover { background: var(--card2); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn.primary:hover { background: #fff; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { background: #d13b40; }
.btn.quiet-danger { color: var(--bad-ink); }
.btn:disabled { opacity: .55; cursor: default; }

.brand { display: flex; align-items: center; gap: 12px; }
.mark { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: var(--r-ctl); background: var(--card2); border: 1px solid var(--line); font-size: 20px; font-weight: 600; }
.brand b { display: block; font-size: 16px; }
.brand small { display: block; color: var(--muted); font-size: 12px; line-height: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.field input { width: 100%; min-height: 44px; padding: 9px 12px; border-radius: var(--r-ctl); border: 1px solid var(--line2); background: var(--card); font-weight: 400; font-size: 16px; }
.field input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.field input::placeholder { color: var(--faint); }
.field small { color: var(--muted); font-weight: 400; font-size: 12px; line-height: 16px; }
.digits { font-variant-numeric: tabular-nums; letter-spacing: .1em; }
.upper { text-transform: uppercase; }
.upper::placeholder { text-transform: none; }

/* connexion */
.login { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px 16px; }
.login-form { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 340px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); }
.login-form .field input { background: var(--bg); }
.login-form .btn { min-height: 44px; }

/* application */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.content { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 24px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.notice { padding: 10px 12px; border-radius: var(--r-ctl); background: var(--card2); border: 1px solid var(--line2); color: var(--bad-ink); font-weight: 500; }

.rooms { display: flex; flex-direction: column; gap: 8px; }
.room { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(170px, 1.2fr) minmax(190px, 1.3fr); gap: 4px 16px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); }
.room.revoked { background: none; }
.room .code { display: block; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .02em; overflow-wrap: anywhere; }
.room.revoked .code { color: var(--muted); }
.room .code a { color: inherit; text-decoration: none; }
.room .code a:hover { text-decoration: underline; }
.room .name { color: var(--muted); overflow-wrap: anywhere; }
.status { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.online .dot { background: var(--ok); }
.revoked .dot { background: none; border: 1px solid var(--faint); }
.online .status { color: var(--ok); }
.revoked .status { color: var(--muted); }
.detail { color: var(--muted); font-size: 12px; line-height: 18px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); }

.journal summary { cursor: pointer; color: var(--muted); font-weight: 500; }
.journal ol { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.journal li { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; color: var(--muted); font-size: 12px; line-height: 18px; font-variant-numeric: tabular-nums; }
.journal li.alert span:nth-child(2) { color: var(--bad-ink); font-weight: 500; }
.journal li.empty-line { display: block; }

dialog { width: calc(100% - 32px); max-width: 460px; padding: 20px; border: 1px solid var(--line2); border-radius: var(--r-card); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog[open] { display: flex; flex-direction: column; gap: 14px; }
dialog form { display: flex; flex-direction: column; gap: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.key-facts { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.key-facts dt { color: var(--muted); font-size: 12px; line-height: 16px; }
.key-facts dd { margin: 0 0 10px; overflow-wrap: anywhere; }
.key-facts code { display: block; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--bg); border: 1px solid var(--line2); font: 14px/20px ui-monospace, 'Cascadia Mono', Consolas, monospace; word-break: break-all; user-select: all; }

@media (max-width: 720px) {
  .room { grid-template-columns: 1fr; gap: 8px; }
  .journal li { grid-template-columns: 1fr; gap: 0; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
  .section-head { align-items: center; }
  .room .btn { flex: 1 1 auto; min-height: 44px; }
}
