/* ═══════════════════════════════════════════════════════════════
   PANEL STAFF — feuille de style
   Direction : « console d'état-major ». Utilitaire, dense, filets
   d'un pixel, noir grisé + blanc cassé, accent laiton très parcimonieux.
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400..700;1,400..700&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* Surfaces — noir grisé */
  --ink-900: #0d0e0f;
  --ink-850: #121314;
  --ink-800: #17191a;
  --ink-750: #1c1f20;
  --ink-700: #232728;
  --ink-600: #2c3133;
  --ink-500: #3a4042;
  --ink-400: #4c5356;

  /* Texte — blanc cassé */
  --chalk:      #ece7dc;
  --chalk-soft: #cfcabf;
  --chalk-dim:  #8d918e;
  --chalk-mute: #6a6e6c;

  /* Accent laiton, utilisé au compte-gouttes */
  --brass:      #c3ae83;
  --brass-dim:  #8a7c5f;

  /* États */
  --ok:     #86ab7d;
  --warn:   #c9a84f;
  --danger: #c4685f;
  --info:   #7e9cb0;

  --line:       #262b2c;
  --line-soft:  #1e2223;

  --sans: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  --r: 3px;
  --sidebar: 236px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.02), 0 8px 28px -18px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--chalk);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Grain très léger : donne de la matière au gris sans coûter une requête */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--chalk); text-decoration: none; }
a:hover { color: #fff; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

::selection { background: var(--brass); color: var(--ink-900); }

/* ───────────────────────── Scrollbars ───────────────────────── */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--ink-850); }
*::-webkit-scrollbar-thumb { background: var(--ink-600); border: 3px solid var(--ink-850); border-radius: 6px; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-500); }

/* ═══════════════ Structure ═══════════════ */

.shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ─── Barre latérale ─── */
.side {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: var(--ink-850);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--line);
}
.brand .mark {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.01em;
  display: block;
  line-height: 1.1;
}
.brand .mark em { font-style: italic; color: var(--brass); }
.brand .sub {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--chalk-mute);
  margin-top: 6px;
  display: block;
}

.nav { padding: 14px 10px 24px; flex: 1; }
.nav-group { margin-bottom: 18px; }
.nav-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--chalk-mute);
  padding: 0 8px 7px;
  display: block;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: var(--r);
  color: var(--chalk-soft);
  font-size: 13.5px;
  position: relative;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav a:hover { background: var(--ink-750); color: var(--chalk); }
.nav a.on { background: var(--ink-700); color: #fff; }
.nav a.on::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 7px;
  bottom: 7px;
  width: 2px;
  background: var(--brass);
}
.nav a .ico { width: 15px; text-align: center; opacity: 0.75; font-size: 13px; }
.nav a .pill {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  background: var(--ink-600);
  color: var(--chalk-soft);
  padding: 1px 6px;
  border-radius: 20px;
}
.nav a .pill.hot { background: var(--danger); color: #fff; }

/* ─── Bloc utilisateur ─── */
.me {
  border-top: 1px solid var(--line);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink-800);
}
.me img { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--ink-600); }
.me .id { min-width: 0; flex: 1; }
.me .n { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .r { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brass-dim); }
.me .out { color: var(--chalk-mute); font-size: 15px; padding: 4px; }
.me .out:hover { color: var(--danger); }

/* ─── Zone principale ─── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 56px;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 19, 20, 0.88);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.crumb { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--chalk-dim); }
.crumb b { color: var(--chalk); font-weight: 500; }
.topbar .spacer { flex: 1; }

.searchbox {
  position: relative;
  width: 260px;
}
.searchbox input {
  width: 100%;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--chalk);
  font-family: var(--sans);
  font-size: 13px;
  padding: 6px 10px 6px 28px;
}
.searchbox input:focus { outline: none; border-color: var(--ink-500); }
.searchbox::before {
  content: '⌕';
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--chalk-mute);
  font-size: 14px;
}

/* Interrupteur de service */
.duty-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--ink-800);
  color: var(--chalk-dim);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.duty-toggle:hover { border-color: var(--ink-500); color: var(--chalk); }
.duty-toggle.on { color: var(--ok); border-color: rgba(134, 171, 125, 0.35); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--chalk-mute); display: inline-block; }
.duty-toggle.on .dot { background: var(--ok); box-shadow: 0 0 0 0 rgba(134, 171, 125, 0.6); animation: pulse 2.2s infinite; }
@keyframes pulse {
  70% { box-shadow: 0 0 0 7px rgba(134, 171, 125, 0); }
  100% { box-shadow: 0 0 0 0 rgba(134, 171, 125, 0); }
}

.content { padding: 30px 24px 64px; max-width: 1320px; width: 100%; }

/* Révélation en cascade au chargement */
.content > * { animation: rise 0.44s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
.content > *:nth-child(1) { animation-delay: 0.02s; }
.content > *:nth-child(2) { animation-delay: 0.07s; }
.content > *:nth-child(3) { animation-delay: 0.12s; }
.content > *:nth-child(4) { animation-delay: 0.17s; }
.content > *:nth-child(5) { animation-delay: 0.21s; }
.content > *:nth-child(n + 6) { animation-delay: 0.25s; }
@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .content > *, .duty-toggle.on .dot { animation: none !important; }
}

/* ═══════════════ En-tête de page ═══════════════ */
.page-head {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 { font-family: var(--serif); font-size: 34px; font-weight: 400; letter-spacing: -0.015em; line-height: 1.05; }
.page-head h1 em { font-style: italic; color: var(--brass); }
.page-head .lede { color: var(--chalk-dim); font-size: 13.5px; margin-top: 5px; max-width: 62ch; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }

/* ═══════════════ Cartes ═══════════════ */
.card {
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card-head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-head h2, .card-head h3 {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  font-weight: 500;
}
.card-head .spacer { flex: 1; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

/* ═══════════════ Grilles ═══════════════ */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g-2-1, .g-1-2 { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

/* ═══════════════ Statistiques ═══════════════ */
.stat {
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 15px 16px 14px;
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ink-500), transparent);
  opacity: 0.6;
}
.stat .k {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--chalk-mute);
}
.stat .v {
  font-family: var(--mono);
  font-size: 29px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-top: 7px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat .d { font-size: 11.5px; color: var(--chalk-dim); margin-top: 7px; }
.stat.accent .v { color: var(--brass); }
.stat.ok .v { color: var(--ok); }
.stat.danger .v { color: var(--danger); }

/* Barre de progression (quota d'heures) */
.bar { height: 4px; background: var(--ink-700); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; background: var(--brass); border-radius: 3px; transition: width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
.bar > i.ok { background: var(--ok); }
.bar > i.warn { background: var(--warn); }

/* ═══════════════ Tableaux ═══════════════ */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--chalk-mute);
  font-weight: 500;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--ink-800);
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr { transition: background 0.1s; }
table.tbl tbody tr:hover { background: var(--ink-800); }
table.tbl td.num, table.tbl td.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12.5px; }
table.tbl td.dim { color: var(--chalk-dim); }
table.tbl .rowlink { color: var(--chalk); font-weight: 500; }
table.tbl .rowlink:hover { color: var(--brass); }

.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--chalk-mute);
}
.empty .big { font-family: var(--serif); font-size: 22px; color: var(--chalk-dim); display: block; margin-bottom: 5px; }
.empty .small { font-size: 12.5px; }

/* ═══════════════ Étiquettes ═══════════════ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 2.5px 7px;
  border-radius: 2px;
  border: 1px solid var(--ink-600);
  color: var(--chalk-soft);
  background: var(--ink-800);
  white-space: nowrap;
}
.tag.ok     { color: var(--ok);     border-color: rgba(134, 171, 125, 0.3); background: rgba(134, 171, 125, 0.07); }
.tag.warn   { color: var(--warn);   border-color: rgba(201, 168, 79, 0.3);  background: rgba(201, 168, 79, 0.07); }
.tag.danger { color: var(--danger); border-color: rgba(196, 104, 95, 0.3);  background: rgba(196, 104, 95, 0.07); }
.tag.info   { color: var(--info);   border-color: rgba(126, 156, 176, 0.3); background: rgba(126, 156, 176, 0.07); }
.tag.brass  { color: var(--brass);  border-color: rgba(195, 174, 131, 0.3); background: rgba(195, 174, 131, 0.07); }
.tag.ghost  { color: var(--chalk-mute); background: transparent; }

/* ═══════════════ Boutons ═══════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--r);
  border: 1px solid var(--ink-600);
  background: var(--ink-750);
  color: var(--chalk);
  cursor: pointer;
  transition: background 0.13s, border-color 0.13s, transform 0.08s;
  white-space: nowrap;
}
.btn:hover { background: var(--ink-700); border-color: var(--ink-500); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--chalk); color: var(--ink-900); border-color: var(--chalk); font-weight: 600; }
.btn.primary:hover { background: #fff; color: var(--ink-900); }
.btn.brass { background: var(--brass); color: var(--ink-900); border-color: var(--brass); font-weight: 600; }
.btn.brass:hover { background: #d4c096; color: var(--ink-900); }
.btn.danger { border-color: rgba(196, 104, 95, 0.4); color: var(--danger); background: rgba(196, 104, 95, 0.06); }
.btn.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--chalk-dim); }
.btn.ghost:hover { background: var(--ink-750); color: var(--chalk); }
.btn.sm { font-size: 12px; padding: 4.5px 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ═══════════════ Formulaires ═══════════════ */
.field { margin-bottom: 15px; }
.field > label {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  margin-bottom: 6px;
}
.field .hint { font-size: 11.5px; color: var(--chalk-mute); margin-top: 5px; }

input[type='text'], input[type='url'], input[type='number'], input[type='date'],
input[type='time'], input[type='search'], input[type='email'], input[type='password'],
textarea, select {
  width: 100%;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--chalk);
  font-family: var(--sans);
  font-size: 13.5px;
  padding: 8px 11px;
  transition: border-color 0.13s, background 0.13s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--ink-400);
  background: var(--ink-750);
}
input::placeholder, textarea::placeholder { color: var(--chalk-mute); }
textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
textarea.code, input.mono { font-family: var(--mono); font-size: 12.5px; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238d918e'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
}
input[type='file'] { font-size: 12.5px; color: var(--chalk-dim); }
input[type='checkbox'], input[type='radio'] { accent-color: var(--brass); width: 15px; height: 15px; vertical-align: -2px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.inline-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--chalk-soft); }

fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 0 0 15px; }
fieldset legend {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  padding: 0 6px;
}

/* ═══════════════ Messages flash ═══════════════ */
.flash {
  border: 1px solid var(--line);
  border-left: 2px solid var(--brass);
  background: var(--ink-800);
  padding: 11px 14px;
  border-radius: var(--r);
  font-size: 13.5px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.flash.ok { border-left-color: var(--ok); }
.flash.err { border-left-color: var(--danger); }
.flash .x { margin-left: auto; color: var(--chalk-mute); cursor: pointer; }

/* ═══════════════ Fil d'activité ═══════════════ */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li {
  display: flex;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.feed li:last-child { border-bottom: 0; }
.feed .when {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--chalk-mute);
  flex: 0 0 82px;
  padding-top: 2px;
}
.feed .what { flex: 1; min-width: 0; }
.feed .what b { font-weight: 600; }
.feed .what .sub { color: var(--chalk-dim); font-size: 12px; }

/* ═══════════════ Effectif ═══════════════ */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.person {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--ink-850);
  transition: border-color 0.13s, background 0.13s;
}
.person:hover { border-color: var(--ink-500); background: var(--ink-800); }
.person img { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--ink-600); flex-shrink: 0; }
.person .nm { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .rk { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--chalk-mute); }
.person .live { margin-left: auto; }

/* ═══════════════ Onglets / filtres ═══════════════ */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a {
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--chalk-mute);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs a:hover { color: var(--chalk-soft); }
.tabs a.on { color: var(--chalk); border-bottom-color: var(--brass); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input, .filters select { width: auto; min-width: 150px; }

/* ═══════════════ Pagination ═══════════════ */
.pager { display: flex; gap: 6px; justify-content: center; padding: 16px; font-family: var(--mono); font-size: 12px; }
.pager a, .pager span {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--chalk-dim);
}
.pager a:hover { border-color: var(--ink-500); color: var(--chalk); }
.pager .cur { background: var(--ink-700); color: var(--chalk); border-color: var(--ink-500); }

/* ═══════════════ Wiki / markdown ═══════════════ */
.prose { font-size: 14.5px; line-height: 1.72; color: var(--chalk-soft); max-width: 76ch; }
.prose h1, .prose h2 { font-family: var(--serif); font-weight: 400; color: var(--chalk); letter-spacing: -0.01em; }
.prose h1 { font-size: 28px; margin: 28px 0 12px; }
.prose h2 { font-size: 22px; margin: 26px 0 10px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 15px; margin: 20px 0 8px; color: var(--chalk); }
.prose p { margin: 0 0 13px; }
.prose ul, .prose ol { margin: 0 0 13px; padding-left: 22px; }
.prose li { margin-bottom: 5px; }
.prose code { font-family: var(--mono); font-size: 12.5px; background: var(--ink-750); padding: 1.5px 5px; border-radius: 2px; color: var(--brass); }
.prose pre { background: var(--ink-800); border: 1px solid var(--line); border-radius: var(--r); padding: 13px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: var(--chalk-soft); }
.prose blockquote { margin: 0 0 13px; padding: 2px 0 2px 14px; border-left: 2px solid var(--brass-dim); color: var(--chalk-dim); font-style: italic; }
.prose a { color: var(--brass); text-decoration: underline; text-underline-offset: 2px; }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 13px; font-size: 13px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.prose th { background: var(--ink-800); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* ═══════════════ Planning ═══════════════ */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.day { background: var(--ink-850); min-height: 130px; padding: 9px; }
.day.today { background: var(--ink-800); }
.day .dh { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--chalk-mute); margin-bottom: 8px; }
.day.today .dh { color: var(--brass); }
.slot {
  background: var(--ink-750);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 6px 7px;
  margin-bottom: 6px;
  font-size: 11.5px;
}
.slot .t { font-family: var(--mono); font-size: 10.5px; color: var(--chalk); }
.slot .who { color: var(--chalk-dim); font-size: 11px; margin-top: 3px; }
.slot.full { border-color: rgba(134, 171, 125, 0.3); }
.slot.mine { border-color: var(--brass-dim); background: rgba(195, 174, 131, 0.06); }
@media (max-width: 900px) { .week { grid-template-columns: 1fr; } .day { min-height: auto; } }

/* ═══════════════ Modale ═══════════════ */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 8, 0.72);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 20px 20px;
  animation: fade 0.16s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--ink-850);
  border: 1px solid var(--ink-600);
  border-radius: var(--r);
  width: 100%;
  max-width: 560px;
  box-shadow: 0 30px 80px -30px #000;
  animation: rise 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
  max-height: 84vh;
  overflow-y: auto;
}

/* ═══════════════ Palette de commandes (⌘K) ═══════════════ */
#cmdk .modal { max-width: 520px; padding: 0; }
#cmdk input {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-size: 15px;
  padding: 14px 16px;
}
#cmdk input:focus { background: transparent; }
#cmdk ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
#cmdk li { padding: 8px 11px; border-radius: var(--r); font-size: 13.5px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
#cmdk li .ico { opacity: 0.6; width: 16px; text-align: center; }
#cmdk li .grp { margin-left: auto; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--chalk-mute); }
#cmdk li.sel { background: var(--ink-700); }

/* ═══════════════ Connexion ═══════════════ */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 38px 32px 30px;
  text-align: center;
  box-shadow: 0 40px 90px -40px #000;
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.login-card .mark { font-family: var(--serif); font-size: 32px; line-height: 1.1; }
.login-card .mark em { font-style: italic; color: var(--brass); }
.login-card .sub {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--chalk-mute);
  margin: 9px 0 26px;
}
.login-card .note { font-size: 12px; color: var(--chalk-mute); margin-top: 20px; line-height: 1.6; }
.rule { height: 1px; background: var(--line); margin: 22px 0; }

.btn-discord {
  width: 100%;
  background: #5865f2;
  border-color: #5865f2;
  color: #fff;
  font-weight: 600;
  padding: 11px;
  font-size: 14px;
}
.btn-discord:hover { background: #4752c4; border-color: #4752c4; color: #fff; }

/* ═══════════════ Divers ═══════════════ */
.mono { font-family: var(--mono); }
.dim { color: var(--chalk-dim); }
.mute { color: var(--chalk-mute); }
.small { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0; }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }
.mb0 { margin-bottom: 0; }
.mb16 { margin-bottom: 16px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.kbd {
  font-family: var(--mono);
  font-size: 10px;
  border: 1px solid var(--ink-600);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--chalk-dim);
  background: var(--ink-800);
}

/* Mobile */
.burger { display: none; background: none; border: 0; color: var(--chalk); font-size: 20px; cursor: pointer; padding: 4px 8px; }
@media (max-width: 860px) {
  .burger { display: block; }
  .side {
    position: fixed;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
    box-shadow: 20px 0 60px -30px #000;
  }
  .side.open { transform: none; }
  .searchbox { display: none; }
  .content { padding: 22px 16px 60px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-head .actions { margin-left: 0; }
  .page-head h1 { font-size: 27px; }
}

@media print {
  .side, .topbar, .actions, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border-color: #ccc; box-shadow: none; }
}

/* ═══════════════ Chat staff ═══════════════ */
.chat-shell {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 16px;
  height: calc(100vh - 56px - 60px);
  min-height: 460px;
}

/* ─── Colonne des salons ─── */
.chat-rooms {
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.chat-rooms-head { padding: 0 6px 8px; }
.chat-room {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border-radius: var(--r);
  color: var(--chalk-soft);
  font-size: 13.5px;
  transition: background 0.12s, color 0.12s;
}
.chat-room:hover { background: var(--ink-750); color: var(--chalk); }
.chat-room.on { background: var(--ink-700); color: #fff; }
.chat-room .hash { color: var(--chalk-mute); font-family: var(--mono); }
.chat-room.on .hash { color: var(--brass); }
.chat-room .rn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-room .lock { color: var(--brass-dim); font-size: 11px; }
.chat-room .pill {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  background: var(--danger);
  color: #fff;
  padding: 1px 6px;
  border-radius: 20px;
}

.chat-newroom { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.chat-newroom summary {
  font-size: 12.5px;
  color: var(--chalk-mute);
  cursor: pointer;
  padding: 4px 8px;
  list-style: none;
}
.chat-newroom summary:hover { color: var(--chalk); }
.chat-newroom form { padding: 8px 6px 0; display: grid; gap: 7px; }
.chat-newroom input, .chat-newroom select { font-size: 12.5px; padding: 6px 9px; }

.chat-online { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.chat-online-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  font-size: 12.5px;
  color: var(--chalk-soft);
}
.chat-online-row img { width: 21px; height: 21px; border-radius: 50%; border: 1px solid var(--ink-600); }
.chat-online-row span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Zone principale ─── */
.chat-main {
  display: flex;
  flex-direction: column;
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: var(--r);
  min-width: 0;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.chat-head h1 { font-family: var(--serif); font-size: 21px; font-weight: 400; }
.chat-topic { font-size: 12px; color: var(--chalk-mute); margin: 3px 0 0; }

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.msg { display: flex; gap: 11px; padding: 5px 0; position: relative; }
.msg .av { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--ink-600); flex-shrink: 0; }
.msg .av-spacer { width: 34px; flex-shrink: 0; }
.msg .msg-body { flex: 1; min-width: 0; }
.msg .meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.msg .who { font-weight: 600; font-size: 13.5px; }
.msg .rank {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass-dim);
  border: 1px solid var(--ink-600);
  border-radius: 2px;
  padding: 0 4px;
}
.msg .when { font-family: var(--mono); font-size: 10px; color: var(--chalk-mute); }
.msg .text { font-size: 14px; line-height: 1.6; color: var(--chalk-soft); white-space: pre-wrap; word-wrap: break-word; }
.msg .text a { color: var(--brass); text-decoration: underline; text-underline-offset: 2px; }
.msg .text .mention { color: var(--brass); background: rgba(195, 174, 131, 0.12); border-radius: 3px; padding: 0 3px; }
.msg.mine .text { color: var(--chalk); }
.msg.gone .text { color: var(--chalk-mute); font-style: italic; }
.msg .edited { font-size: 10px; color: var(--chalk-mute); margin-left: 5px; }
.msg:hover { background: var(--ink-800); border-radius: var(--r); }
.msg .tools {
  position: absolute;
  right: 6px;
  top: 2px;
  display: none;
  gap: 4px;
  background: var(--ink-750);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 2px;
}
.msg:hover .tools { display: flex; }
.msg .tools button {
  background: none;
  border: 0;
  color: var(--chalk-mute);
  font-size: 11px;
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 2px;
  font-family: var(--sans);
}
.msg .tools button:hover { background: var(--ink-600); color: var(--chalk); }
.msg .tools button.del:hover { background: var(--danger); color: #fff; }

.chat-daysep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 10px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--chalk-mute);
}
.chat-daysep::before, .chat-daysep::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.chat-compose {
  display: flex;
  gap: 9px;
  align-items: flex-end;
  padding: 12px 16px 6px;
  border-top: 1px solid var(--line);
}
.chat-compose textarea {
  flex: 1;
  min-height: 42px;
  max-height: 190px;
  resize: none;
  line-height: 1.5;
  padding: 11px 13px;
}
.chat-compose .btn { flex-shrink: 0; height: 42px; }
.chat-hint { padding: 0 16px 11px; }

@media (max-width: 900px) {
  .chat-shell { grid-template-columns: 1fr; height: auto; }
  .chat-rooms { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .chat-rooms-head, .chat-online, .chat-newroom { display: none; }
  .chat-log { max-height: 58vh; }
}
