/* Azuro FA — style repris de la maquette « Panel Staff » (Geist, cadre noir, panneau arrondi). */
:root {
  --frame: #000000;
  --panel: #111113;
  --card: #17171a;
  --chip: #232327;
  --border: #2a2a2f;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #60a5fa;
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --btn: #f4f4f5;
  --btn-text: #0a0a0b;
  --field: #0e0e10;
  --primary: #2563eb;
  --bar: #1e3a8a;
  --page-bg: #0a0a0b;
  --glow: rgba(37, 99, 235, 0.22);
  --overlay: rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --panel: #ffffff;
  --card: #ffffff;
  --chip: #f1f1f3;
  --border: #e4e4e7;
  --text: #0a0a0b;
  --muted: #52525b;
  --accent: #1d4ed8;
  --ok: #166534;
  --warn: #854d0e;
  --bad: #b91c1c;
  --btn: #0a0a0b;
  --btn-text: #ffffff;
  --field: #fafafa;
  --bar: #bfdbfe;
  --page-bg: #fafafa;
  --glow: rgba(37, 99, 235, 0.09);
  --overlay: rgba(10, 10, 11, 0.45);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--frame);
  color: var(--text);
  font: 14px/1.4 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
a { color: var(--accent); text-decoration: none; }
h1 { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -0.02em; }
h2 { margin: 0 0 14px; font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
b { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 12px; }
.boot { padding: 80px 16px; text-align: center; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ── Pages publiques (connexion, accès refusé, candidature) */
.public {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 28px 16px 32px;
  background-color: var(--page-bg);
  background-image: radial-gradient(ellipse 48% 46% at 50% 56%, var(--glow), transparent 72%);
}
.public-head { position: relative; width: 100%; display: flex; justify-content: center; align-items: center; min-height: 44px; }
.public-head .logo { height: 52px; width: auto; display: block; }
.public-head .theme { position: absolute; right: 0; top: 0; }
.public-main { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 48px 0; }
.public-main h1 { font-size: 42px; letter-spacing: -0.035em; text-align: center; }
.public-main .lead { margin: 0 0 22px; font-size: 16px; color: var(--muted); text-align: center; max-width: 520px; }
.public-card { width: 100%; max-width: 540px; padding: 24px; border: 1px solid var(--border); border-radius: 22px; background: var(--card); display: grid; gap: 10px; }
.public-wide { width: 100%; max-width: 1080px; }
.public-foot { font-size: 13px; color: var(--muted); }
.discord-btn { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--field); color: var(--text); font-size: 15px; font-weight: 500; }
.discord-btn:hover { border-color: var(--muted); }
.discord-btn svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.discord-btn span { flex: 1; text-align: center; }
.discord-btn::after { content: ''; width: 22px; flex: none; }

/* ── Panel : cadre noir, barre latérale, panneau arrondi */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 250px; max-width: 290px; min-width: 0; padding: 24px 16px 16px; display: flex; flex-direction: column; gap: 22px; color: #e4e4e7; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
/* Barre latérale : on garde le défilement mais sans barre visible. */
.side { scrollbar-width: none; -ms-overflow-style: none; }
.side::-webkit-scrollbar { display: none; }
.side .brand { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 8px 0; text-align: center; }
.side .brand img { display: block; width: 120px; height: auto; }
.side .brand span { font-size: 12px; color: #a1a1aa; }
.server { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #27272a; border-radius: 12px; background: #101012; }
.server img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.server div { display: flex; flex-direction: column; min-width: 0; }
.server b { color: #fff; }
.server span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #a1a1aa; }
.nav { display: flex; flex-direction: column; gap: 18px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 0 8px 6px; font-size: 13px; color: #a1a1aa; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; font-weight: 500; color: #f4f4f5; border: 1px solid transparent; }
.nav a:hover { background: #121214; }
.nav a.active { background: #18181b; border-color: #2e2e33; }
.nav a span { flex: 1; }
.nav .count { flex: none; font-style: normal; padding: 2px 8px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 600; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border: 1px solid #27272a; border-radius: 12px; margin-top: auto; }
.me .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.me .who b { color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { font-size: 12px; }
.me .avatar { background: #27272a; color: #fff; }
.icon-btn { width: 44px; height: 44px; flex: none; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.me .icon-btn { border: 0; color: #a1a1aa; }
.icon-btn:hover { color: var(--text); background: var(--chip); }
.me .icon-btn:hover { color: #fff; background: #18181b; }

.main { flex: 999 1 560px; min-width: 0; margin: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; align-self: flex-start; min-height: calc(100vh - 24px); }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.crumb { font-size: 17px; }
.crumb span { color: var(--muted); }
.topbar .tools { display: flex; align-items: center; gap: 10px; }
.status { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; color: var(--muted); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: #22c55e; } .dot.bad { background: #ef4444; }
.notice { margin: 16px 24px 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--chip); color: var(--warn); font-size: 13px; }
#page { padding: 0 24px 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 -24px 24px; padding: 24px; border-bottom: 1px solid var(--border); }
.page-head .grow { flex: 1; min-width: 220px; }
.page-head p { margin: 6px 0 0; font-size: 16px; color: var(--muted); }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── Composants */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 22px 24px; min-width: 0; }
.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 14px; }
.stat { display: flex; flex-direction: column; gap: 14px; color: var(--text); }
.stat:hover { border-color: var(--muted); }
.stat .l { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; }
.stat .l svg { width: 17px; height: 17px; }
.stat .n { font-size: 36px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.cols { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.cols > * { flex: 1.4 1 460px; min-width: 0; }
.cols > :last-child { flex: 1 1 320px; }
.cols > .wide, .cols > .narrow { display: grid; gap: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head, .card.flush > .toolbar { padding: 18px 24px; margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--chip); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.solid { background: var(--btn); border-color: var(--btn); color: var(--btn-text); }
.btn.danger { color: var(--bad); }
.btn.danger.solid, .btn.danger.fill { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn.ok { color: var(--ok); }
.btn.ok.fill { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.ghost { border-color: transparent; }
.btn:disabled { opacity: .5; cursor: default; background: transparent; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

input, select, textarea { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--field); color: var(--text); font: inherit; font-size: 14px; }
textarea { min-height: 88px; padding: 12px 14px; line-height: 1.5; resize: vertical; font-size: 15px; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--primary); }
input[type=color] { padding: 4px; width: 64px; }
label.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
label.field > span { font-size: 14px; font-weight: 500; }
.check { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 160px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.toolbar select { width: auto; min-width: 180px; }
.search { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--field); color: var(--muted); flex: 0 1 300px; }
.search svg { width: 16px; height: 16px; }
.search input { border: 0; background: transparent; min-height: 0; padding: 0; flex: 1; min-width: 0; }
.search input:focus-visible { outline: none; }
.search:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs button { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.tabs button.active { background: var(--btn); border-color: var(--btn); color: var(--btn-text); }

.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--chip); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.ok { color: var(--ok); } .badge.warn { color: var(--warn); } .badge.bad { color: var(--bad); } .badge.info { color: var(--accent); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 18px; background: var(--card); }
.card.flush .table-wrap { border: 0; border-radius: 0; border-top: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 24px 12px 0; border-top: 1px solid var(--border); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 24px; }
thead th { border-top: 0; font-size: 13px; font-weight: 400; color: var(--muted); white-space: nowrap; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--chip); }
td.nowrap { white-space: nowrap; }
td.wrap { overflow-wrap: break-word; min-width: 110px; color: var(--muted); }
.empty { padding: 32px; text-align: center; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: var(--chip); color: var(--text); font-weight: 600; font-size: 12px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person > span { display: flex; flex-direction: column; min-width: 0; }
.list > .item { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.list > .item .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.list > .item .tag { flex: none; width: 150px; }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; align-items: end; height: 210px; margin-top: 20px; }
.bars .bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; font-size: 13px; color: var(--muted); }
.bars .bar b { color: var(--text); }
.bars .bar i { display: block; width: 100%; max-width: 52px; min-height: 4px; border-radius: 8px 8px 4px 4px; background: var(--bar); }
.bars .bar:last-child i { background: var(--primary); }

/* ── Hiérarchie */
.rank-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.rank-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.rank-head h2::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.rank-head .push { margin-left: auto; }
.members { display: flex; flex-wrap: wrap; gap: 8px; }
.member { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--field); }
.member b { padding-right: 6px; }
.member button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font: inherit; }
.member button:hover { background: var(--chip); color: var(--text); }
.perm-list { display: grid; gap: 10px; }
.perm-list label { display: flex; gap: 10px; align-items: flex-start; }

/* ── Transcript et candidatures */
.chat { display: flex; flex-direction: column; gap: 12px; max-height: 64vh; overflow-y: auto; padding-right: 4px; }
.msg { display: flex; gap: 12px; }
.msg .body { min-width: 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--field); overflow-wrap: anywhere; white-space: pre-wrap; font-size: 15px; }
.msg.bot .body { background: var(--chip); }
.msg .meta { font-size: 13px; color: var(--muted); margin-bottom: 4px; white-space: normal; }
.msg .meta b { color: var(--text); }
.qa { margin-bottom: 18px; }
.qa .q { font-size: 15px; font-weight: 500; margin-bottom: 8px; }
.qa .a { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--field); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.5; }
.sent { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 40px 24px; }
.sent .tick { width: 48px; height: 48px; border-radius: 50%; background: var(--chip); color: var(--ok); display: flex; align-items: center; justify-content: center; }
.sent p { margin: 0; max-width: 420px; color: var(--muted); font-size: 15px; }

/* ── Fenêtres et notifications */
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: var(--overlay); }
.modal { width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; padding: 24px; border: 1px solid var(--border); border-radius: 22px; background: var(--card); }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 30; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
.toast::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 10px; border-radius: 50%; background: #22c55e; vertical-align: middle; }
.toast.error::before { background: #ef4444; } .toast.warn::before { background: #f59e0b; }

@media (max-width: 860px) {
  .side { position: static; height: auto; max-width: none; flex-basis: 100%; padding: 16px 12px 0; gap: 14px; }
  .side .brand img { width: 130px; }
  .server { display: none; }
  .nav { flex-direction: row; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
  .nav-group { flex-direction: row; gap: 4px; }
  .nav-label { display: none; }
  .nav a { white-space: nowrap; }
  .me { margin-top: 0; }
  .main { margin: 12px 8px; min-height: 0; }
  #page { padding: 0 16px 16px; }
  .page-head { margin: 0 -16px 16px; padding: 18px 16px; }
  .topbar { padding: 12px 16px; }
  .search { flex-basis: 100%; }
  .public-main h1 { font-size: 32px; }
}

/* ── Cloche de notifications */
.bell { position: relative; }
.bell .icon-btn { position: relative; }
.bell .dot-count { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; font-style: normal; font-weight: 700; line-height: 18px; text-align: center; }
.bell-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 15; width: min(320px, calc(100vw - 32px)); padding: 14px 16px; box-shadow: 0 16px 40px rgba(0, 0, 0, .4); }
.bell-menu .item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.bell-menu .item:hover { color: var(--accent) !important; }
