/* Système de composants d'Ammit, commun au portail des propriétaires et à
   l'interface d'administration : variables (palette tirée de l'emblème : bleu
   nuit, bleu électrique, or), typographie, coquille de page, navigation,
   cartes, formulaires, tableaux, états, notifications, fenêtres. Chaque
   application n'ajoute que ses pages propres (style.css). Thème sombre unique. */

:root {
  --bg: #090d18;
  --bg-2: #0d1322;
  --surface: #0f1526;
  --surface-2: #151d31;
  --surface-3: #1b2540;
  --border: #1f2a44;
  --border-strong: #2d3b5e;
  --text: #e8edfa;
  --text-2: #b4bfd9;
  --muted: #7f8cac;
  --accent: #3d7eff;
  --accent-strong: #6b9bff;
  --accent-soft: rgba(61, 126, 255, .14);
  --gold: #d9b35b;
  --gold-strong: #efcf7a;
  --gold-soft: rgba(217, 179, 91, .14);
  --good: #2fbf71;
  --good-soft: rgba(47, 191, 113, .14);
  --warn: #e3a23c;
  --warn-soft: rgba(227, 162, 60, .14);
  --bad: #e5484d;
  --bad-soft: rgba(229, 72, 77, .14);
  --info: #58a6ff;
  --info-soft: rgba(88, 166, 255, .14);
  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 32px -16px rgba(0, 0, 0, .7);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --topbar: 58px;
  --speed: 150ms;
  color-scheme: dark;
}

/* ------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--font); min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; font-weight: 700; margin: 0 0 1rem; }
h2 { font-size: 1.08rem; font-weight: 650; margin: 0 0 .75rem; }
h3 { font-size: .95rem; font-weight: 650; margin: 1rem 0 .4rem; }
p { margin: .5rem 0; }
ul, ol { padding-left: 1.3rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
code, .mono { font-family: var(--font-mono); font-size: .9em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; overflow-wrap: anywhere; }
pre { font-family: var(--font-mono); }
img { max-width: 100%; }
dialog { color: inherit; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: .88rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Icônes vectorielles (icons.html) : trait uniforme, taille de la police. */
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.big { width: 1.6em; height: 1.6em; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------------------------------------------------------- barre du haut */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem;
  height: var(--topbar); padding: 0 1.25rem; background: rgba(13, 19, 34, .92);
  border-bottom: 1px solid var(--border); backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 700; font-size: 1rem;
  text-decoration: none; flex: none; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border-strong); }
.brand small { display: block; font-weight: 500; font-size: .72rem; color: var(--muted); line-height: 1.1; }
.primary-nav, .menu { display: flex; align-items: center; gap: .15rem; flex: 1; min-width: 0; }
.primary-nav a, .menu a {
  display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .8rem; border-radius: var(--radius-s);
  color: var(--text-2); font-weight: 500; white-space: nowrap; text-decoration: none;
  transition: background var(--speed), color var(--speed);
}
.primary-nav a:hover, .menu a:hover { background: var(--surface-2); color: var(--text); }
.primary-nav a.active, .menu a.active { background: var(--accent-soft); color: var(--text); }
.primary-nav a.active .icon { color: var(--accent-strong); }
.topbar-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; flex: none; }
.topbar-actions form { margin: 0; }
.topbar .shop-link {
  display: inline-flex; align-items: center; gap: .4rem; padding: .42rem .85rem; border-radius: 999px;
  border: 1px solid rgba(217, 179, 91, .45); background: var(--gold-soft); color: var(--gold-strong);
  font-weight: 600; font-size: .9rem; white-space: nowrap;
}
.topbar .shop-link:hover { background: rgba(217, 179, 91, .22); text-decoration: none; }
.topbar .shop-link.active { box-shadow: inset 0 0 0 1px var(--gold); }
.menu-toggle { display: none; }
.menu-toggle summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .6rem; border-radius: var(--radius-s); border: 1px solid var(--border); color: var(--text-2); }
.menu-toggle summary::-webkit-details-marker { display: none; }
.user-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .7rem .3rem .4rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-2); font-size: .88rem; max-width: 220px; }
.user-chip .avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); display: inline-flex;
  align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; color: var(--text); }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ pages */
.page { width: 100%; max-width: 1240px; margin: 0 auto; padding: 1.5rem 1.5rem 3rem; flex: 1; }
.page.narrow { max-width: 460px; padding-top: 5vh; }
.page.medium { max-width: 820px; }
.footer { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; justify-content: center; align-items: center;
  padding: 1rem 1.5rem 1.5rem; font-size: .84rem; color: var(--muted); border-top: 1px solid var(--border); }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }

/* En-tête de page : titre, texte d'accompagnement, actions à droite. */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.page-head .lead { color: var(--text-2); margin: .3rem 0 0; max-width: 70ch; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.eyebrow { display: block; font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .25rem; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; color: var(--muted); font-size: .86rem;
  margin: 0 0 .75rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .icon { width: .95em; height: .95em; opacity: .7; }

/* ------------------------------------------------------- espace à barre latérale */
.manage, .with-side { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 0 1.75rem; align-items: start; }
.manage > *, .with-side > * { grid-column: 2; min-width: 0; }
.manage > .sidenav, .with-side > .sidenav {
  grid-column: 1; grid-row: 1 / span 500; position: sticky; top: calc(var(--topbar) + 1rem); align-self: start;
  max-height: calc(100vh - var(--topbar) - 1.5rem); overflow-y: auto; scrollbar-width: thin; padding-right: .25rem;
}
.sidenav .side-head { display: flex; align-items: center; gap: .7rem; margin: 0 0 .9rem; padding: 0 .25rem; }
.sidenav .side-head h1 { font-size: 1rem; margin: 0; overflow-wrap: anywhere; }
.sidenav .side-head p { margin: 0; }
.sidenav .server-icon.large { width: 44px; height: 44px; border-radius: 12px; }
.sidenav .sections { display: flex; flex-direction: column; gap: .1rem; }
.sidenav .section > a {
  display: flex; align-items: center; gap: .55rem; padding: .5rem .7rem; border-radius: var(--radius-s);
  color: var(--text-2); text-decoration: none; font-weight: 500; transition: background var(--speed), color var(--speed);
}
.sidenav .section > a .icon { color: var(--muted); }
.sidenav .section > a:hover { background: var(--surface-2); color: var(--text); }
.sidenav .section.active > a { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.sidenav .section.active > a .icon { color: var(--accent-strong); }
.sidenav .section ul { list-style: none; margin: .15rem 0 .5rem; padding: 0 0 0 .55rem; display: flex; flex-direction: column;
  gap: .05rem; border-left: 1px solid var(--border); margin-left: 1.05rem; }
.sidenav .section li a { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .3rem .6rem;
  border-radius: var(--radius-s); color: var(--muted); font-size: .88rem; text-decoration: none;
  transition: background var(--speed), color var(--speed); }
.sidenav .section li a:hover { color: var(--text); background: var(--surface-2); }
.sidenav .section li a.active { color: var(--text); background: var(--surface-2); font-weight: 600; }
.sidenav .section li a.active::before { content: ""; width: 3px; height: 1rem; border-radius: 2px; background: var(--accent);
  margin-left: -.95rem; margin-right: .4rem; flex: none; }
.sidenav .section li .count-pill { margin-left: auto; }
.sidenav .side-foot { margin-top: 1rem; padding: .75rem .25rem 0; border-top: 1px solid var(--border); font-size: .84rem; }

/* En-tête du contenu (sous la barre latérale sur mobile) : fil d'Ariane, titre, actions. */
.content-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin: 0 0 1.1rem; padding-bottom: .9rem; border-bottom: 1px solid var(--border); }
.content-head .crumbs { margin: 0 0 .25rem; }
.content-head h1 { margin: 0; font-size: 1.4rem; }
.content-head .lead { margin: .25rem 0 0; color: var(--text-2); }
.content-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ------------------------------------------------------------------ cartes */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l);
  padding: 1.15rem 1.3rem; margin-bottom: 1rem;
}
.card > :last-child { margin-bottom: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  margin-bottom: .75rem; }
.card-head h2 { margin: 0; }
.card-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.card.alert, .alert-card { border-color: rgba(227, 162, 60, .5); background: linear-gradient(0deg, var(--warn-soft), var(--warn-soft)) var(--surface); }
.card.danger { border-color: rgba(229, 72, 77, .4); }
.card.danger h2 { color: var(--bad); }
.card.premium-banner { border-color: rgba(217, 179, 91, .45); }
.card.premium-banner h2 { color: var(--gold-strong); }
.card.subtle { background: var(--bg-2); }
.card.compact { padding: .85rem 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-bottom: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid > .card { margin-bottom: 0; }
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 1rem; }
.stat-grid > .card { margin-bottom: 0; }
.stat-card { display: flex; flex-direction: column; gap: .2rem; }
.stat-card > .muted:first-child { font-size: .84rem; font-weight: 500; }
.stat-card strong { font-size: 1.65rem; line-height: 1.2; letter-spacing: -.02em; overflow-wrap: anywhere; }
.stat-card strong.stat-name { font-size: 1.1rem; }
a.stat-card { text-decoration: none; color: inherit; transition: border-color var(--speed); }
a.stat-card:hover { border-color: var(--accent); }
.stat .big { font-size: 1.6rem; font-weight: 700; margin: .1rem 0; letter-spacing: -.02em; }
.stat p { margin: .2rem 0; }
.facts { display: grid; grid-template-columns: minmax(6rem, auto) minmax(0, 1fr); gap: .4rem 1.1rem; margin: 0 0 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: break-word; }
.facts.compact { margin: .5rem 0; }
.plain-list { list-style: none; padding: 0; margin: .5rem 0; }
.plain-list li { padding: .3rem 0; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.history li:last-child { border-bottom: 0; }
.prose { max-width: 760px; }
.prose li { margin: .35rem 0; }
.key-value { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; align-items: baseline; }
.divider { border-top: 1px solid var(--border); margin: .9rem 0; }

/* Lignes d'une liste (serveurs, commandes…). */
.rows { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.row-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .9rem; align-items: center;
  padding: .85rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); text-decoration: none; transition: border-color var(--speed), background var(--speed); }
a.row-card:hover { border-color: var(--border-strong); background: var(--surface-2); text-decoration: none; }
.row-card .row-title { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-weight: 600; }
.row-card .row-meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; color: var(--muted); font-size: .86rem; margin-top: .15rem; }
.row-card .row-side { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.row-card .icon.chevron { color: var(--muted); }

/* --------------------------------------------------------------- boutons */
button, .button {
  font: inherit; font-weight: 600; font-size: .92rem; color: #fff; background: var(--accent); border: 1px solid transparent;
  border-radius: var(--radius-s); padding: .55rem 1rem; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; line-height: 1.25;
  transition: background var(--speed), border-color var(--speed), color var(--speed), transform var(--speed);
}
button:hover, .button:hover { background: var(--accent-strong); text-decoration: none; color: #fff; }
button:active, .button:active { transform: translateY(1px); }
button:disabled, .button[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
button.secondary, .button.secondary { background: transparent; color: var(--accent-strong); border-color: rgba(61, 126, 255, .55); }
button.secondary:hover:not(:disabled), .button.secondary:hover { background: var(--accent-soft); color: var(--accent-strong); }
button.ghost, .button.ghost { background: transparent; color: var(--text-2); border-color: var(--border-strong); }
button.ghost:hover:not(:disabled), .button.ghost:hover { background: var(--surface-2); color: var(--text); }
button.danger, .button.danger { background: var(--bad); }
button.danger:hover:not(:disabled), .button.danger:hover { background: #ef6468; }
button.danger.secondary, .button.danger.secondary { background: transparent; color: var(--bad); border-color: rgba(229, 72, 77, .5); }
button.danger.secondary:hover:not(:disabled) { background: var(--bad-soft); }
button.gold, .button.gold { background: var(--gold); color: #1a1407; }
button.gold:hover:not(:disabled), .button.gold:hover { background: var(--gold-strong); color: #1a1407; }
button.link, .button.link { background: none; border: 0; padding: 0; color: var(--accent-strong); font-weight: 500;
  text-decoration: underline; border-radius: 0; }
button.link:hover:not(:disabled) { background: none; color: var(--text); }
button.small, .button.small { padding: .32rem .65rem; font-size: .84rem; }
button.big, .button.big { padding: .75rem 1.4rem; font-size: 1rem; }
button.block, .button.block { display: flex; width: 100%; }
.button.discord { background: #5865f2; color: #fff; }
.button.discord:hover { background: #4752c4; }
/* Bouton grisé qui reste cliquable pour donner sa raison (inscriptions fermées). */
.button[aria-disabled="true"] { filter: grayscale(1); }
.button.secondary[aria-disabled="true"]:hover { background: transparent; }
.button.discord[aria-disabled="true"]:hover { background: #5865f2; }
.actions-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin: 0 0 1rem; }
.actions-row.end { justify-content: flex-end; }
form.inline { display: inline-flex; gap: .3rem; align-items: center; margin: 0; }
.inline-form { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; margin-top: .75rem; }
.inline-form .grow { flex: 1; min-width: 200px; }

/* ------------------------------------------------------------ formulaires */
label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; color: var(--text-2); font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date],
input[type=url], input[type=tel], input[type=datetime-local], select, textarea {
  font: inherit; font-weight: 400; color: var(--text); background: var(--bg-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius-s); padding: .55rem .75rem; min-width: 0; width: 100%;
  transition: border-color var(--speed), box-shadow var(--speed);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled, select:disabled, textarea:disabled { opacity: .55; }
input[aria-invalid="true"], .invalid input { border-color: var(--bad); }
textarea { resize: vertical; min-height: 5rem; }
select { appearance: none; -webkit-appearance: none; padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237f8cac' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center; background-size: 1rem; }
select[multiple] { background-image: none; padding-right: .75rem; }
input[type=checkbox], input[type=radio] { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); margin: 0; flex: none; }
input[type=color] { width: 3rem; height: 2.2rem; padding: .15rem; border: 1px solid var(--border-strong); border-radius: var(--radius-s);
  background: var(--bg-2); }
input.short { width: 10rem; }
label.check { flex-direction: row; align-items: center; gap: .55rem; color: var(--text); font-weight: 400; cursor: pointer; }
label.check.strong { font-weight: 600; }
.field-label { display: block; font-size: .9rem; color: var(--text-2); margin-bottom: .3rem; font-weight: 500; }
.hint, .setting-hint { color: var(--muted); font-size: .84rem; margin: 0 0 .5rem; font-weight: 400; }
.setting-hint.inline { display: inline; margin-left: .5rem; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.form-grid { display: grid; gap: .8rem 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-actions { position: sticky; bottom: 0; display: flex; gap: .6rem; flex-wrap: wrap; align-items: center;
  padding: .75rem 0; background: var(--surface); border-top: 1px solid var(--border); margin-top: .5rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .9rem; margin: 0; min-width: 0; }
legend { color: var(--muted); font-size: .88rem; padding: 0 .3rem; }
.choice-list { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; max-height: 14rem; overflow-y: auto; }
.settings-form { display: flex; flex-direction: column; gap: .75rem; }
.settings-group { border: 1px solid var(--border); border-radius: var(--radius); padding: 0 1rem; background: var(--bg-2); }
.settings-group > summary { cursor: pointer; padding: .8rem 0; font-weight: 600; }
.settings-group[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: .25rem; }
.setting { padding: .8rem 0; border-top: 1px solid var(--border); }
.settings-group .setting { border-top: 0; border-bottom: 1px solid var(--border); }
.settings-group .setting:last-child { border-bottom: 0; }
.setting-head { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .45rem; }
.setting-label { flex-direction: row; color: var(--text); font-weight: 600; font-size: .95rem; }
.setting.locked { opacity: .8; }
.role-list { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.search-field { position: relative; }
.search-field .icon { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-field input { padding-left: 2.3rem; }
.option { display: flex; flex-direction: row; align-items: flex-start; gap: .75rem; padding: .85rem; border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); cursor: pointer; font-weight: 400; background: var(--bg-2);
  transition: border-color var(--speed); }
.option:hover { border-color: var(--border-strong); }
.option.chosen { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.option input { margin-top: .3rem; }
.option-body { display: flex; flex-direction: column; gap: .3rem; }
.option-title, .channel-list { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

/* --------------------------------------------------------------- tableaux */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.card .table-wrap { margin: 0 0 .5rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { color: var(--muted); font-weight: 600; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase;
  background: var(--bg-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, .015); }
td.reason { max-width: 340px; overflow-wrap: anywhere; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: .8rem; }
.table-tools label { font-size: .84rem; gap: .2rem; }
.table-tools .grow { flex: 1; min-width: 200px; }
.mod-filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: .75rem; }
.mod-filters label { font-size: .85rem; gap: .2rem; }
.mod-filters input[type=search] { min-width: 14rem; }
.pagination { display: flex; gap: 1rem; align-items: center; margin-top: .75rem; font-size: .9rem; }
.pagination a { display: inline-flex; align-items: center; gap: .3rem; padding: .35rem .7rem; border: 1px solid var(--border);
  border-radius: var(--radius-s); color: var(--text-2); }
.pagination a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.ranking { width: 100%; border-collapse: collapse; }
.ranking th { font-weight: 400; text-align: left; width: 40%; padding: .35rem .5rem .35rem 0; overflow-wrap: anywhere;
  text-transform: none; letter-spacing: 0; font-size: inherit; background: none; }
.ranking td { padding: .35rem .5rem .35rem 0; }
.ranking .meter-cell { width: 45%; }
.ranking .count { text-align: right; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ranking meter { width: 100%; height: .75rem; }
meter { accent-color: var(--accent); }

/* ------------------------------------------------------- badges et états */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .76rem; font-weight: 600; padding: .12rem .55rem;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  white-space: nowrap; vertical-align: middle; line-height: 1.4;
}
.badge.good, .badge.ok { color: var(--good); border-color: rgba(47, 191, 113, .4); background: var(--good-soft); }
.badge.warn { color: var(--warn); border-color: rgba(227, 162, 60, .4); background: var(--warn-soft); }
.badge.bad, .badge.danger { color: var(--bad); border-color: rgba(229, 72, 77, .4); background: var(--bad-soft); }
.badge.info { color: var(--info); border-color: rgba(88, 166, 255, .4); background: var(--info-soft); }
.badge.premium, .badge.gold { color: var(--gold-strong); border-color: rgba(217, 179, 91, .5); background: var(--gold-soft); }
.badge.soon { opacity: .65; border-style: dashed; }
.badge.level { text-transform: lowercase; }
.status { display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; white-space: nowrap; }
.status::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--muted); flex: none;
  box-shadow: 0 0 0 3px rgba(127, 140, 172, .18); }
.status.ok::before { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.status.warn::before { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.status.bad::before, .status.danger::before { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.status.info::before { background: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }
.status.gold::before { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.count-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 1.45em; height: 1.45em; padding: 0 .4em;
  border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--accent); color: #fff; line-height: 1; }
.count-pill.warn { background: var(--warn); color: #1a1407; }
.count-pill.bad { background: var(--bad); }
.count-pill.quiet { background: var(--surface-3); color: var(--text-2); }
.status-list { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .35rem; }
.status-list li { display: flex; align-items: flex-start; gap: .5rem; padding: .1rem 0; }
.status-list li::before { content: "✓"; flex: none; width: 1.25rem; height: 1.25rem; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; margin-top: .1rem;
  background: var(--surface-3); color: var(--muted); }
.status-list li.yes::before { content: "✓"; background: var(--good-soft); color: var(--good); }
.status-list li.no::before { content: "✕"; background: var(--bad-soft); color: var(--bad); }
.status-list li.off::before { content: "–"; }
.status-list li.todo::before { content: "!"; background: var(--warn-soft); color: var(--warn); }
.status-active { color: var(--good); }
.status-revoked, .status-expired { color: var(--muted); }
.prio { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .8rem; border: 1px solid var(--border); white-space: nowrap; }
.prio-urgente { color: #fff; background: var(--bad); border-color: var(--bad); }
.prio-haute { color: var(--warn); border-color: rgba(227, 162, 60, .5); }
.prio-normale { color: var(--muted); }
.prio-basse { color: var(--muted); border-style: dashed; }
.state { display: inline-block; padding: .05rem .5rem; border-radius: var(--radius-s); font-size: .8rem; background: var(--surface-2); white-space: nowrap; }
.state.closed { opacity: .7; }

/* ---------------------------------------------------------- notifications */
.notice { display: flex; gap: .7rem; align-items: flex-start; padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem;
  background: var(--surface-2); border: 1px solid var(--border); border-left-width: 4px; color: var(--text); }
.notice .icon { margin-top: .15rem; color: var(--text-2); }
.notice.ok { border-left-color: var(--good); background: var(--good-soft); }
.notice.ok .icon { color: var(--good); }
.notice.err { border-left-color: var(--bad); background: var(--bad-soft); }
.notice.err .icon { color: var(--bad); }
.notice.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.notice.warn .icon { color: var(--warn); }
.notice.info { border-left-color: var(--info); background: var(--info-soft); }
.notice[hidden] { display: none; }
.notice.info .icon { color: var(--info); }
.notice.premium { border-left-color: var(--gold); background: var(--gold-soft); }
.notice form.inline { margin-left: auto; }
.notice > div, .notice > p { margin: 0; flex: 1; }

/* États vides, chargement, erreurs. */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .4rem; padding: 2rem 1rem;
  color: var(--muted); }
.empty .icon { width: 2rem; height: 2rem; color: var(--border-strong); stroke-width: 1.5; }
.empty strong { color: var(--text-2); font-weight: 600; }
.empty p { margin: 0; max-width: 46ch; }
.empty .actions { margin-top: .5rem; display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--radius-s); min-height: 1rem; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.error-page { text-align: center; padding: 3rem 1rem; }
.error-page .code { font-size: 3rem; font-weight: 700; color: var(--border-strong); letter-spacing: -.04em; line-height: 1; }
.error-page h1 { margin: .5rem 0 .4rem; }
.error-page p { color: var(--text-2); max-width: 52ch; margin: 0 auto 1rem; }

/* ----------------------------------------------------- onglets et filtres */
.tabs, .chips { display: flex; gap: .3rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a, .chips a, .chips button { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .85rem; border-radius: 999px;
  color: var(--text-2); border: 1px solid var(--border); text-decoration: none; background: transparent; font-weight: 500;
  font-size: .9rem; transition: background var(--speed), border-color var(--speed), color var(--speed); }
.tabs a:hover, .chips a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.tabs a.active, .chips a.active { color: var(--text); background: var(--accent-soft); border-color: rgba(61, 126, 255, .5); }
.tabs .filter-label { align-self: center; color: var(--muted); font-size: .84rem; margin-right: .3rem; }
.subtabs { display: flex; flex-direction: column; gap: .2rem; }
.subtabs a { padding: .5rem .75rem; border-radius: var(--radius-s); color: var(--muted); text-decoration: none; }
.subtabs a:hover { background: var(--surface-2); color: var(--text); }
.subtabs a.active { background: var(--accent-soft); color: var(--text); font-weight: 600; }

/* ---------------------------------------------------------- fenêtre modale */
.confirm-dialog {
  border: 1px solid var(--border-strong); border-radius: var(--radius-l); padding: 1.3rem 1.5rem; max-width: 440px; width: calc(100% - 2rem);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.confirm-dialog::backdrop { background: rgba(5, 8, 16, .7); backdrop-filter: blur(2px); }
.confirm-dialog h2 { margin: 0 0 .6rem; font-size: 1.1rem; }
.confirm-dialog p { margin: 0 0 1rem; color: var(--text-2); }
.confirm-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; }
.confirm-actions .button, .confirm-actions button { min-width: 5rem; }
.confirm-card { max-width: 640px; }

/* ----------------------------------------------------------- serveurs */
.server-icon { width: 48px; height: 48px; border-radius: 12px; flex: none; object-fit: cover; background: var(--surface-3); }
.server-icon.large { width: 64px; height: 64px; border-radius: 16px; }
.server-icon.round { border-radius: 50%; }
.server-icon.placeholder { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.2rem;
  color: var(--text-2); }
.server-head { display: flex; align-items: center; gap: 1rem; }
.server-head h1, .server-head h2 { margin: 0; }
.server-head p { margin: 0; }
.server-card { color: var(--text); text-decoration: none; display: block; transition: border-color var(--speed); }
.server-card:hover { border-color: var(--accent); text-decoration: none; }

/* ----------------------------------------------------------- connexion */
.auth { overflow: hidden; padding-top: 0; }
.auth .auth-banner { display: block; width: calc(100% + 2.6rem); max-width: none; margin: 0 -1.3rem 0; aspect-ratio: 1200 / 426; object-fit: cover; }
.auth .auth-logo { width: 84px; height: 84px; border-radius: 50%; display: block; margin: 1rem auto .5rem; border: 3px solid var(--surface);
  background: var(--bg); box-shadow: 0 0 0 1px var(--border-strong); }
.auth .auth-banner + .auth-logo { position: relative; margin-top: -42px; }
.auth h1 { text-align: center; margin-bottom: .25rem; }
.auth > p.muted:first-of-type, .auth .auth-lead { text-align: center; margin-top: 0; }
.auth .stack { margin-top: 1rem; }
.auth-alt { margin: 1rem 0 .4rem; display: grid; gap: .5rem; }
.auth-alt .button { display: flex; }
.separator { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .86rem; margin: 1rem 0 0; }
.separator::before, .separator::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.links { margin-top: 1rem; text-align: center; }

/* --------------------------------------------------------------- premium */
details.danger-zone { margin-top: 1rem; }
details.danger-zone summary { cursor: pointer; color: var(--muted); }
details.danger-zone[open] summary { margin-bottom: .6rem; }
.premium-line { color: var(--text-2); }

/* -------------------------------------------------------------- mobile */
@media (max-width: 1024px) {
  .manage, .with-side { grid-template-columns: 1fr; gap: 0; }
  .manage > *, .with-side > * { grid-column: 1; }
  .manage > .sidenav, .with-side > .sidenav { grid-row: auto; position: relative; top: auto; max-height: none; overflow: visible;
    margin-bottom: 1rem; padding-right: 0; }
  .sidenav .side-head { margin-bottom: .6rem; }
  .sidenav .sections { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: .3rem; padding-bottom: .4rem;
    -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .sidenav .section { flex: 0 0 auto; position: static; }
  .sidenav .section > a { white-space: nowrap; padding: .4rem .7rem; }
  .sidenav .section ul { display: none; }
  .sidenav .section.active ul { display: flex; position: absolute; left: 0; right: 0; flex-direction: row; flex-wrap: nowrap;
    overflow-x: auto; gap: .25rem; padding: .3rem 0 0; margin: 0; border-left: 0; }
  .sidenav.has-links { padding-bottom: 2.6rem; }
  .sidenav .section li a { white-space: nowrap; }
  .sidenav .section li a.active::before { display: none; }
  .sidenav .side-foot { display: none; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 .9rem; gap: .6rem; height: auto; min-height: var(--topbar); flex-wrap: wrap; padding-top: .5rem; padding-bottom: .5rem; }
  .menu-toggle { display: block; order: 2; margin-left: auto; }
  .topbar-actions { order: 3; margin-left: 0; }
  .primary-nav, .menu { order: 4; flex-basis: 100%; flex-direction: column; align-items: stretch; display: none; padding-top: .4rem; }
  .topbar.open .primary-nav, .topbar.open .menu, .menu-toggle[open] ~ .primary-nav, .menu-toggle[open] ~ .menu { display: flex; }
  .primary-nav a, .menu a { padding: .6rem .8rem; }
  .user-chip span { display: none; }
  .page { padding: 1rem 1rem 2.5rem; }
  .card { padding: 1rem; border-radius: var(--radius); }
  .facts { grid-template-columns: 1fr; gap: .1rem .5rem; }
  .facts dt { margin-top: .5rem; }
  .facts dt:first-child { margin-top: 0; }
  .row-card { grid-template-columns: auto minmax(0, 1fr); }
  .row-card .row-side { grid-column: 1 / -1; justify-content: flex-start; }
  .content-head h1 { font-size: 1.25rem; }
  .form-actions { position: static; }
  .stat-card strong { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
