/* XTRIM — feuille de style commune */

:root {
  color-scheme: dark;

  --bg:        #0e1116;
  --surface:   #161b22;
  --surface-2: #1c2129;
  --border:    #30363d;
  --text:      #e6edf3;
  --muted:     #8b949e;
  --accent:    #238636;
  --accent-h:  #2ea043;
  --danger:    #f85149;
  --ok:        #3fb950;
  --link:      #58a6ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Ecrans centres (connexion, inscription…) ---------- */

body.centre {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

h1 {
  margin: 0 0 4px;
  font-size: 26px;
  letter-spacing: .5px;
}

.sub {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Formulaires ---------- */

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 16px;
  background: #0d1117;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--link);
}

button {
  width: 100%;
  padding: 11px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

button:hover:not(:disabled) { background: var(--accent-h); }
button:disabled { opacity: .5; cursor: not-allowed; }

button.secondaire {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
button.secondaire:hover:not(:disabled) { background: var(--surface-2); }

button.danger { background: var(--danger); }
button.danger:hover:not(:disabled) { background: #ff6a60; }

button.auto { width: auto; padding: 8px 16px; font-size: 14px; }

/* ---------- Messages d'etat ---------- */

.msg {
  margin-top: 16px;
  min-height: 20px;
  font-size: 14px;
}
.msg.ok  { color: var(--ok); }
.msg.err { color: var(--danger); }

/* ---------- Liens ---------- */

.liens {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Barre du haut ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.topbar .marque { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.topbar .infos  { color: var(--muted); font-size: 14px; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.badge.admin { background: #1f6feb22; border-color: #1f6feb; color: #79c0ff; }
.badge.en-ligne { background: #23863622; border-color: var(--accent); color: var(--ok); }

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

.contenu {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: 20px;
}

@media (min-width: 820px) {
  .contenu.deux-colonnes { grid-template-columns: 1fr 1fr; align-items: start; }
}

.panneau {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.panneau h2 {
  margin: 0 0 16px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
}

/* ---------- Listes ---------- */

.ligne {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.ligne:last-child { border-bottom: 0; }
.ligne .nom { font-weight: 600; }
.ligne .detail { color: var(--muted); font-size: 13px; }

.vide { color: var(--muted); font-size: 14px; font-style: italic; }

dl.profil { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
dl.profil dt { color: var(--muted); font-size: 14px; }
dl.profil dd { margin: 0; font-size: 14px; word-break: break-all; }

/* ---------- Messagerie ---------- */

.fil {
  height: 300px;
  overflow-y: auto;
  padding: 12px;
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bulle {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  word-wrap: break-word;
}
.bulle.envoye {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 3px;
}
.bulle.recu {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 3px;
}
.bulle .horo { display: block; margin-top: 3px; font-size: 11px; opacity: .7; }

.envoi { display: flex; gap: 8px; }
.envoi input { margin-bottom: 0; }
.envoi button { width: auto; padding: 10px 18px; }

code {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 13px;
}
