/* Panel Unanim RP — palette de DESIGN_TOKENS.md (brun-noir chaud, accents orange / or).
   Regle : l'orange ne porte jamais de texte blanc ; sur fond orange, texte fonce. */

:root {
    --bg-900: #0d0806;
    --bg-850: #140c08;
    --bg-800: #1a100a;
    --bg-700: #2a1810;
    --line: #4a2a1c;
    --line-soft: rgba(255, 255, 255, 0.07);
    --orange: #ff8c00;
    --orange-400: #ffa733;
    --orange-700: #cc6600;
    --gold: #ffc107;
    --gold-300: #ffd966;
    --text: #ffffff;
    --text-2: #c7c7c7;
    --muted: #9a8f88;
    --ok: #3cb371;
    --warn: #ffc107;
    --err: #e63946;
    --info: #4fa3d1;
    --on-accent: #1a100a;
    --accent-soft: rgba(255, 140, 0, 0.13);

    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Bebas Neue', 'Arial Narrow', Impact, sans-serif;
    --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
    --r: 8px;
    --r-card: 12px;
    --side-w: 240px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg-900); color: var(--text-2); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; color: var(--text); line-height: 1.2; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: var(--r); background: var(--gold); color: var(--on-accent); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }
.ic { width: 18px; height: 18px; flex-shrink: 0; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.nowrap { white-space: nowrap; }
small { font-size: 12.5px; }

/* ------------------------------------------------------------ Boutons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--line);
    background: var(--bg-700); color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none;
    cursor: pointer; white-space: nowrap; transition: background-color 150ms, border-color 150ms, box-shadow 150ms, transform 120ms;
}
.btn:hover { border-color: var(--orange-700); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-busy="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(135deg, var(--gold), var(--orange)); border-color: transparent; color: var(--on-accent); }
.btn.primary:hover { box-shadow: 0 0 22px rgba(255, 140, 0, 0.35); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: rgba(230, 57, 70, 0.55); color: #ff8a93; }
.btn.danger:hover { background: rgba(230, 57, 70, 0.12); border-color: var(--err); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.discord { min-height: 50px; width: 100%; background: #5865f2; border-color: transparent; color: #fff; font-size: 15px; }
.btn.discord:hover { background: #4752c4; }
.btn.discord .ic { width: 22px; height: 22px; }
.icon-btn {
    display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r);
    border: 1px solid var(--line-soft); background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.link { color: var(--orange-400); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.link:hover { text-decoration: underline; }

/* ------------------------------------------------------------ Structure */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
    padding: 18px 14px; background: var(--bg-850); border-right: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 8px; text-decoration: none; }
.brand img { height: 36px; width: auto; }
.brand span { font-family: var(--font-display); font-size: 26px; letter-spacing: 0.05em; color: var(--text); line-height: 1; }
.brand small { display: block; font-family: var(--font); font-size: 10.5px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--orange-400); margin-top: 3px; }
/* Le menu defile s'il ne tient pas : le compteur de joueurs (side-foot) reste visible en bas. */
.side-nav {
    display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-height: 0;
    overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
    margin: 0 -6px; padding: 0 6px;
}
.side-nav a {
    display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: var(--r);
    color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 14.5px; transition: background-color 150ms, color 150ms;
}
.side-nav a:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.side-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--text); box-shadow: inset 3px 0 0 var(--orange); }
.side-nav a[aria-current="page"] .ic { color: var(--orange-400); }
.side-foot { margin-top: auto; flex: none; }
/* Ecrans peu hauts : lignes du menu resserrees pour tout voir sans defiler. */
@media (max-height: 1000px) {
    .sidebar { gap: 12px; padding-top: 14px; padding-bottom: 14px; }
    .side-nav a { min-height: 36px; }
    .sidebar .nav-sep { margin: 10px 12px 4px; }
}
.server-pill {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r);
    background: var(--bg-800); border: 1px solid var(--line-soft); text-decoration: none; font-size: 13px;
}
.server-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(60, 179, 113, 0.18); }
.server-pill b { color: var(--text); font-variant-numeric: tabular-nums; }
.server-pill.off i { background: var(--err); box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.18); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
    min-height: 72px; padding: 12px 28px; background: rgba(13, 8, 6, 0.94); border-bottom: 1px solid var(--line-soft);
}
.titles { min-width: 0; flex: 1; }
.titles h1 { font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titles p { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-toggle { display: none; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip img { width: 36px; height: 36px; border-radius: 50%; }
.user-chip .who { display: flex; flex-direction: column; line-height: 1.25; }
.user-chip b { color: var(--text); font-size: 14px; }
.role { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.role::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--role, #99aab5); }
/* Largeur de lecture plafonnee et CENTREE : sur un ecran large, le contenu
   ne reste pas colle a gauche avec un vide a droite. Au-dela de 1900 px de
   large, le plafond monte et les marges s'elargissent (voir plus bas). */
.content { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 18px; max-width: 1440px; width: 100%; margin-inline: auto; }

/* ------------------------------------------------------------ Cartes */
.card { background: var(--bg-800); border: 1px solid var(--line-soft); border-radius: var(--r-card); padding: 18px 20px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card.flush .card-h { margin: 0; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.card-h h2 { display: flex; align-items: center; gap: 10px; font-size: 15.5px; font-weight: 700; }
.card-h h2 .ic { color: var(--orange-400); }
.card-note { font-size: 12.5px; color: var(--muted); }
.count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 9999px; background: var(--bg-700); color: var(--text-2); font-size: 12px; font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.span-2 { grid-column: 1 / -1; }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.col-main, .col-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.col-side { position: sticky; top: 90px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.crumbs a { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs .ic { width: 16px; height: 16px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r); background: var(--accent-soft); border: 1px solid rgba(255, 140, 0, 0.25); font-size: 14px; }
.note .ic { color: var(--orange-400); margin-top: 2px; }
.note b { color: var(--text); }

/* Chiffres cles */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--r-card); background: var(--bg-800); border: 1px solid var(--line-soft); min-width: 0; }
.stat-ic { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--orange-400); }
.stat-ic .ic { width: 22px; height: 22px; }
.stat > div:last-child { min-width: 0; }
.stat-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.stat-value { display: block; font-size: 22px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.stat.is-online .stat-ic { background: rgba(60, 179, 113, 0.14); color: var(--ok); }
.stat.is-offline .stat-ic { background: rgba(230, 57, 70, 0.14); color: var(--err); }
.stat-record { margin-top: 3px; }
.stat-record b { color: var(--orange-400); font-weight: 700; font-variant-numeric: tabular-nums; }
/* Cinq chiffres cles (boutique) : 5 colonnes quand la place le permet, sinon
   3 + 2, puis 2 + 2 + 1 (le dernier sur toute la largeur), puis 1 colonne. */
@media (min-width: 1601px) { .stats.stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1201px) and (max-width: 1600px) {
    .stats.stats-5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .stats.stats-5 > .stat { grid-column: span 2; }
    .stats.stats-5 > .stat:nth-child(n+4) { grid-column: span 3; }
}
@media (min-width: 561px) and (max-width: 1200px) { .stats.stats-5 > .stat:last-child { grid-column: 1 / -1; } }

/* ------------------------------------------------------------ Tableaux */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; width: 1%; }
.table .actions .btn { margin-left: 4px; }
.table td.details { max-width: 420px; color: var(--text-2); }
.card:not(.flush) .table th:first-child, .card:not(.flush) .table td:first-child { padding-left: 0; }
.who { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.who b { display: block; color: var(--text); }
.who small { display: block; color: var(--muted); }
a.who:hover b { color: var(--orange-400); }
.avatar { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: var(--bg-700); border: 1px solid var(--line); color: var(--gold-300); font-size: 13px; font-weight: 700; }
.avatar.lg { width: 64px; height: 64px; border-radius: 16px; font-size: 22px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--bg-700); color: var(--text); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.pager-n { font-size: 13px; color: var(--muted); }

/* Pastilles */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 9999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--bg-700); color: var(--text-2); }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge .ic { width: 13px; height: 13px; }
.badge.ok { background: rgba(60, 179, 113, 0.14); color: #7ddba4; }
.badge.err { background: rgba(230, 57, 70, 0.14); color: #ff8a93; }
.badge.warn { background: rgba(255, 193, 7, 0.14); color: var(--gold-300); }
.badge.muted { color: var(--muted); }

/* Fil d'actions */
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.feed li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.feed li:last-child { border-bottom: 0; }
.feed b { color: var(--text); }
.feed-meta { flex-shrink: 0; color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; align-items: center; }

/* ------------------------------------------------------------ Formulaires */
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.inline { flex-direction: row; align-items: center; gap: 10px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="datetime-local"], select, textarea {
    width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--r); border: 1px solid var(--line);
    background: var(--bg-900); color: var(--text); font-size: 14px; transition: border-color 150ms, box-shadow 150ms;
}
textarea { resize: vertical; min-height: 80px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange-700); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--muted); }
input[type="date"], input[type="datetime-local"] { color-scheme: dark; }
.form-error { color: #ff8a93; font-size: 13.5px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.check input, .tick input { width: 18px; height: 18px; accent-color: var(--orange); cursor: pointer; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.toolbar.compact { justify-content: flex-start; }
.toolbar .field.inline { flex-direction: row; }
.toolbar select { width: auto; }
.search { position: relative; flex: 1 1 320px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 40px; }

/* ------------------------------------------------------------ Fiches */
.hero-card { display: flex; align-items: center; gap: 18px; }
.hero-avatar { width: 72px; height: 72px; border-radius: 18px; flex-shrink: 0; object-fit: cover; }
.hero-main { min-width: 0; }
.hero-main h2 { font-size: 22px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.hero-main h2 small { font-size: 14px; font-weight: 500; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 8px; font-size: 14px; }
.hero-meta > span, .hero-meta > a { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta .ic { width: 16px; height: 16px; color: var(--muted); }
.hero-meta > a .ic { color: currentColor; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 14px; }
.kv.two { grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.money-row { display: flex; flex-wrap: wrap; gap: 12px; }
.money { flex: 1 1 105px; padding: 12px 14px; border-radius: var(--r); background: var(--bg-900); border: 1px solid var(--line-soft); }
.money span { display: block; font-size: 12.5px; color: var(--muted); }
.money b { font-size: 20px; color: var(--text); font-variant-numeric: tabular-nums; }
.inv { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.inv li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: var(--r); background: var(--bg-900); border: 1px solid var(--line-soft); font-size: 13.5px; }
.inv-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv b { color: var(--text); font-variant-numeric: tabular-nums; flex-shrink: 0; }
/* Cartes en petit nombre (lots de la boutique, personnages) : disposition
   flexible plutot qu'une grille. Chaque carte part de 260 px et grandit
   jusqu'a 400 px avec la place disponible : sur un grand ecran, quatre lots
   remplissent la rangee au lieu de rester etroits a cote de colonnes vides,
   et une carte seule ne s'etire pas sur toute la page. (Une grille auto-fit
   avec un maximum compterait ses colonnes d'apres ce maximum, donc en
   ferait trop peu sur un ecran moyen.) */
.char-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.char-grid > * { flex: 1 1 260px; max-width: 400px; }
.char-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--bg-900); border: 1px solid var(--line-soft); text-decoration: none; transition: border-color 150ms; }
.char-card:hover { border-color: var(--orange-700); }
.char-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.char-body b { color: var(--text); }
.char-body small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------ Permissions */
.perm-table th.role-col, .perm-table td.role-col { text-align: center; width: 1%; white-space: nowrap; padding-left: 18px; padding-right: 18px; }
.perm-table th.role-col .role { font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--text); }
.perm-table .group-row th { background: var(--bg-850); color: var(--orange-400); font-size: 12px; padding-top: 12px; padding-bottom: 8px; }
.perm-table td b { color: var(--text); font-weight: 600; }
.tick { display: inline-grid; place-items: center; width: 40px; height: 40px; cursor: pointer; }
.tick input:disabled { cursor: not-allowed; opacity: 0.55; }
.savebar {
    position: sticky; bottom: 16px; z-index: 10; display: flex; align-items: center; gap: 10px; justify-content: flex-end;
    margin-top: 12px; padding: 12px 16px; border-radius: var(--r-card); background: var(--bg-700); border: 1px solid var(--line);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 180ms, transform 180ms var(--ease);
}
.savebar span { margin-right: auto; color: var(--text); font-weight: 600; font-size: 14px; }
.perm-form.dirty .savebar { opacity: 1; transform: none; pointer-events: auto; }

/* ------------------------------------------------------------ Etats, messages */
.empty { padding: 18px 20px; color: var(--muted); font-size: 14px; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 64px 20px; gap: 10px; }
.empty-state.small { padding: 44px 20px; }
.empty-state h2 { font-size: 18px; }
.empty-state .btn { margin-top: 10px; }
.empty-ic { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 14px; background: var(--accent-soft); color: var(--orange-400); }
.empty-ic .ic { width: 26px; height: 26px; }
.flash { padding: 11px 14px; border-radius: var(--r); font-size: 14px; border: 1px solid; }
.flash.ok { background: rgba(60, 179, 113, 0.1); border-color: rgba(60, 179, 113, 0.35); color: #9be3b9; }
.flash.warn { background: rgba(255, 193, 7, 0.08); border-color: rgba(255, 193, 7, 0.3); color: var(--gold-300); }
.flash.err, .flash.error { background: rgba(230, 57, 70, 0.1); border-color: rgba(230, 57, 70, 0.35); color: #ff9aa2; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.toast {
    display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r);
    background: var(--bg-700); border: 1px solid var(--line); color: var(--text); font-size: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); animation: toastIn 220ms var(--ease);
}
.toast::before { content: ''; flex-shrink: 0; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--info); }
.toast.ok::before { background: var(--ok); }
.toast.err::before { background: var(--err); }
.toast.wait::before { background: var(--gold); animation: pulse 1s ease-in-out infinite; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: 0.35; } }

.modal { border: 0; padding: 0; background: transparent; color: inherit; width: min(460px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(5, 3, 2, 0.72); }
.modal-box { display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: var(--r-card); background: var(--bg-800); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); }
.modal-box h2 { font-size: 18px; }
.modal-text { color: var(--text-2); font-size: 14.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ------------------------------------------------------------ Connexion */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
    background: radial-gradient(ellipse 70% 55% at 50% 100%, rgba(255, 140, 0, 0.28), transparent 70%), var(--bg-900); }
.auth-card { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 32px 28px; border-radius: 16px; background: var(--bg-800); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
.auth-logo { width: 150px; height: auto; filter: drop-shadow(0 12px 28px rgba(255, 140, 0, 0.3)); }
.auth-card h1 { font-family: var(--font-display); font-weight: 400; font-size: 40px; letter-spacing: 0.04em; line-height: 1; }
.auth-sub { font-size: 14.5px; }
.auth .flash { width: 100%; text-align: left; }

/* ------------------------------------------------------------ Responsive */
/* Tres grands ecrans (1440p, 4K) : plus de largeur utile et un peu plus
   d'air, sans changer la taille du texte (c'est le reglage d'echelle du
   systeme qui s'en charge). */
@media (min-width: 1900px) {
    .content { max-width: 1720px; padding: 32px 40px 56px; gap: 22px; }
    .topbar { padding: 12px 40px; }
}
@media (max-width: 1200px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .layout-side { grid-template-columns: 1fr; }
    .col-side { position: static; }
    .kv.two { grid-template-columns: max-content minmax(0, 1fr); }
}
@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform 200ms var(--ease); box-shadow: 20px 0 40px rgba(0, 0, 0, 0.5); }
    .sidebar.open { transform: none; }
    .nav-toggle { display: inline-grid; }
    .topbar { padding: 10px 16px; }
    .content { padding: 18px 16px 40px; }
    .grid-2 { grid-template-columns: 1fr; }
    .user-chip .who { display: none; }
}
@media (max-width: 560px) {
    .stats { grid-template-columns: 1fr; }
    .row { grid-template-columns: 1fr; }
    /* Le bouton de suppression pousserait la page en largeur : il passe
       dessous, sur toute la largeur. */
    .hero-card { align-items: flex-start; flex-wrap: wrap; }
    .hero-actions { margin-left: 0; width: 100%; }
    .hero-actions .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* ------------------------------------------------------------ Onglets, filtres, pastilles */
.text { color: var(--text); }
.badge.info { background: rgba(79, 163, 209, 0.14); color: #8cc8e8; }
.badge.tx { background: rgba(155, 89, 182, 0.16); color: #d2a8ea; }
.badge.lib { background: rgba(255, 255, 255, 0.06); color: var(--text-2); }
.log-table .tag { font-size: 11.5px; padding: 1px 6px; margin-right: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); }
.tabs a { padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 14px; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--orange); }
.tabs a .count { height: 20px; min-width: 20px; margin-left: 6px; padding: 0 6px; font-size: 11.5px; vertical-align: 1px; }
.warn-text { color: var(--gold-300); }
.wl-reasons { display: flex; flex-wrap: wrap; gap: 4px; }
.wl-manual { margin-top: 5px; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chips a { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 9999px; border: 1px solid var(--line-soft); background: var(--bg-800); color: var(--text-2); text-decoration: none; font-size: 13px; font-weight: 600; }
.chips a:hover { border-color: var(--line); color: var(--text); }
.chips a[aria-current="true"] { background: var(--accent-soft); border-color: rgba(255, 140, 0, 0.4); color: var(--text); }
.chips a b { color: var(--muted); font-variant-numeric: tabular-nums; }
.chips .card-note { margin-left: 6px; }
.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--bg-900); border: 1px solid var(--line-soft); }
.seg button { min-height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--bg-700); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.log-table td.details { max-width: 640px; }

/* ------------------------------------------------------------ Graphiques (SVG dessines par app.js) */
.chart { position: relative; min-height: 220px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: rgba(255, 255, 255, 0.06); }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .hover-line { stroke: rgba(255, 255, 255, 0.25); stroke-dasharray: 3 3; }
.chart-empty { display: grid; place-items: center; min-height: 200px; color: var(--muted); font-size: 14px; text-align: center; padding: 0 20px; }
.chart-tip {
    position: absolute; z-index: 5; pointer-events: none; min-width: 120px; padding: 8px 10px; border-radius: 8px;
    background: var(--bg-700); border: 1px solid var(--line); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
    font-size: 12.5px; color: var(--text-2); white-space: nowrap;
}
.chart-tip b { display: block; color: var(--text); font-size: 12px; margin-bottom: 4px; }
.chart-tip span { display: flex; align-items: center; gap: 6px; }
.chart-tip i, .chart-legend i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; font-size: 12.5px; color: var(--text-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Carte de chaleur : jours x heures */
.heatmap { overflow-x: auto; }
.hm-grid { display: grid; grid-template-columns: 44px repeat(24, minmax(22px, 1fr)); gap: 3px; min-width: 640px; }
.hm-grid .hm-day, .hm-grid .hm-hour { font-size: 11px; color: var(--muted); display: flex; align-items: center; }
.hm-grid .hm-hour { justify-content: center; }
.hm-cell { height: 26px; border-radius: 4px; background: var(--bg-900); border: 1px solid var(--line-soft); }
.hm-cell:hover { outline: 1px solid var(--orange-400); outline-offset: 1px; }
.hm-tip { position: fixed; z-index: 60; }
.hm-tip .hm-tip-note { color: var(--muted); margin-top: 3px; }

/* Infobulle des barres rendues par PHP (bar_tip), affichee par app.js */
.bar-tip { position: fixed; z-index: 60; min-width: 190px; }
.bar-tip-row { display: grid; grid-template-columns: 8px 1fr auto; column-gap: 8px; align-items: center; padding: 2px 0; }
.bar-tip-row em { font-style: normal; color: var(--text-2); }
.bar-tip-row strong { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.bar-tip-row i.in { background: linear-gradient(180deg, var(--gold), var(--orange)); }
.bar-tip-row i.out { background: rgba(230, 57, 70, 0.7); }
.bar-tip-note { margin-top: 5px; color: var(--muted); }
.daybar:hover .daybar-b, .monthbar:hover .monthbar-b { box-shadow: inset 0 0 0 1px var(--orange-400); }
.hm-legend { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.hm-scale { width: 140px; height: 10px; border-radius: 9999px; background: linear-gradient(90deg, rgba(255, 140, 0, 0.08), var(--orange)); }

/* ------------------------------------------------------------ Sections du menu */
.nav-sep { display: block; margin: 14px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.side-nav .nav-sep:first-child { margin-top: 0; }

/* ------------------------------------------------------------ Espace joueur */
.me-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.me-card {
    display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: var(--r-card);
    background: var(--bg-900); border: 1px solid var(--line-soft); text-decoration: none;
    transition: border-color 150ms, transform 150ms var(--ease);
}
.me-card:hover { border-color: var(--orange-700); transform: translateY(-2px); }
.me-top { display: flex; align-items: center; gap: 14px; }
.me-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; align-items: flex-start; }
.me-id b { font-size: 16px; color: var(--text); }
.me-rows { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.me-rows > span { display: flex; align-items: center; gap: 8px; }
.me-rows .ic { width: 15px; height: 15px; color: var(--muted); }
.me-more { display: inline-flex; align-items: center; gap: 4px; margin-top: auto; font-size: 13px; font-weight: 600; color: var(--orange-400); }
.me-more .ic { width: 15px; height: 15px; }
.sub-h { margin: 18px 0 10px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 9999px; font-size: 12.5px; font-weight: 600; background: var(--bg-900); border: 1px solid var(--line-soft); }
.pill .ic { width: 13px; height: 13px; }
.pill.on { color: #9be3b9; border-color: rgba(60, 179, 113, 0.35); }
.pill.off { color: var(--muted); }
.pill.wait { color: var(--gold-300); border-color: rgba(255, 193, 7, 0.3); }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.list li:last-child { border-bottom: 0; }
.list .num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ------------------------------------------------------------ Fiche personnage en onglets */
/* Les onglets defilent en largeur quand ils ne tiennent pas. overflow-x seul
   fait passer l'autre axe en « auto » : le -1px des onglets (qui mordent sur
   le filet du bas) suffisait alors a faire apparaitre une barre verticale. */
.char-tabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.char-tabs a { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.char-tabs a .ic { width: 16px; height: 16px; color: var(--muted); }
.char-tabs a[aria-current="page"] .ic { color: var(--orange-400); }
.count.warn { background: rgba(255, 193, 7, 0.16); color: var(--gold-300); }
.char-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.char-switch a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 6px; border-radius: 9999px; border: 1px solid var(--line-soft); background: var(--bg-800); color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.char-switch a:hover { border-color: var(--line); color: var(--text); }
.char-switch a[aria-current="page"] { border-color: rgba(255, 140, 0, 0.5); background: var(--accent-soft); color: var(--text); }
.char-switch .cs-all { padding-left: 10px; }
.char-switch .ic { width: 15px; height: 15px; }
.avatar.sm { width: 28px; height: 28px; border-radius: 9999px; font-size: 11px; }
.stack-cards { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* Jauges */
.gauges { display: flex; flex-direction: column; gap: 12px; }
.gauges.tight { gap: 7px; }
.gauge { display: grid; grid-template-columns: 1fr auto; row-gap: 5px; font-size: 13px; }
.gauge-l { color: var(--text-2); }
.gauge-v { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.gauge-bar { grid-column: 1 / -1; height: 6px; border-radius: 9999px; background: var(--bg-900); overflow: hidden; }
.gauge-bar i, .slot-dur i { display: block; height: 100%; width: var(--p, 0%); border-radius: inherit; background: var(--ok); transition: width 300ms var(--ease); }
.gauge.mid .gauge-bar i { background: var(--gold); }
.gauge.low .gauge-bar i { background: var(--err); }
.gauges.tight .gauge { font-size: 12px; }
.gauges.tight .gauge-bar { height: 4px; }

/* Raccourcis de l'apercu */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.quick-i { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--r-card); background: var(--bg-800); border: 1px solid var(--line-soft); text-decoration: none; transition: border-color 150ms; }
.quick-i:hover { border-color: var(--orange-700); }
.quick-i .ic { color: var(--orange-400); margin-bottom: 6px; }
.quick-i b { font-size: 20px; color: var(--text); font-variant-numeric: tabular-nums; }
.quick-i span { font-size: 12.5px; color: var(--muted); }

/* Vehicules */
.veh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.veh-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-card); background: var(--bg-800); border: 1px solid var(--line-soft); text-decoration: none; transition: border-color 150ms, transform 150ms var(--ease); }
.veh-card:hover { border-color: var(--orange-700); transform: translateY(-2px); }
/* Carte avec bouton Supprimer (staff) : le bouton se pose en bas a droite, en face de « Détails ». */
.veh-card-wrap { position: relative; display: flex; }
.veh-card-wrap > .veh-card { flex: 1; min-width: 0; }
.veh-del {
    position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 5px;
    min-height: 30px; padding: 0 10px; border-radius: var(--r); border: 1px solid rgba(230, 57, 70, 0.45);
    background: var(--bg-800); color: #ff8a93; font-size: 12.5px; font-weight: 600; cursor: pointer;
    transition: background-color 150ms, border-color 150ms;
}
.veh-del:hover { background: rgba(230, 57, 70, 0.12); border-color: var(--err); }
.veh-del:disabled { opacity: 0.5; cursor: not-allowed; }
.veh-del .ic { width: 14px; height: 14px; }
.veh-top { display: flex; align-items: center; gap: 12px; }
.veh-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.veh-id b { color: var(--text); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.veh-ic { width: 42px; height: 42px; flex-shrink: 0; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--orange-400); }
.veh-ic.lg { width: 72px; height: 72px; border-radius: 18px; }
.veh-ic.lg .ic { width: 32px; height: 32px; }
.plate { display: inline-block; padding: 3px 9px; border-radius: 6px; background: #f4f1e6; color: #1b2a5c; font-family: var(--mono); font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; border: 1px solid #c9c4b3; white-space: nowrap; vertical-align: middle; }
.hero-main h2 .plate { font-size: 14px; }
.veh-where .badge .ic { width: 13px; height: 13px; }

/* Comptes bancaires, proprietes */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.acc-card { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--r-card); background: linear-gradient(135deg, var(--bg-700), var(--bg-800)); border: 1px solid var(--line); font-size: 13.5px; }
.acc-type { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange-400); }
.acc-name { color: var(--text); font-size: 16px; }
.acc-bal { margin-top: 6px; font-size: 24px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.acc-iban { font-size: 12px; color: var(--muted); }
.acc-perms { font-size: 12.5px; color: var(--muted); }
.acc-card.house .acc-name { font-size: 17px; }
.pos { color: #7ddba4; }
.neg { color: #ff9aa2; }
.late { color: #ff9aa2; font-weight: 600; }
.stat.is-warn .stat-ic { background: rgba(255, 193, 7, 0.14); color: var(--gold); }

/* Inventaire */
.weight { margin-bottom: 14px; }
.slots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.slots.compact { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px 10px; border-radius: 10px; background: var(--bg-900); border: 1px solid var(--line-soft); text-align: center; min-width: 0; }
.slot img { width: 48px; height: 48px; object-fit: contain; }
.slot-ic { width: 48px; height: 48px; display: grid; place-items: center; color: var(--muted); }
.slot-n { font-size: 12px; color: var(--text-2); line-height: 1.25; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.slot-c { position: absolute; top: 6px; right: 8px; font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.slot-dur { width: 80%; height: 3px; border-radius: 9999px; background: var(--bg-700); overflow: hidden; }

/* Retrait d'objets par le staff (onglet Inventaire). Le bouton d'une case
   apparait au survol (ou au clavier) sur ordinateur, toujours sur ecran tactile. */
.slot-rm {
    position: absolute; top: 4px; left: 4px; width: 30px; height: 30px; display: grid; place-items: center; padding: 0;
    border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer;
    transition: color 150ms, background-color 150ms, border-color 150ms, opacity 150ms;
}
.slot-rm .ic { width: 15px; height: 15px; }
.slot-rm:hover, .slot-rm:focus-visible { color: #ff8a93; background: rgba(230, 57, 70, 0.12); border-color: rgba(230, 57, 70, 0.55); }
.slot-rm:disabled { cursor: not-allowed; opacity: 0.35; }
@media (hover: hover) {
    .slot-rm:not(:focus-visible) { opacity: 0; }
    .slot:hover .slot-rm, .slot:focus-within .slot-rm { opacity: 1; }
    .slot:hover .slot-rm:disabled { opacity: 0.35; }
}
.slot.is-busy { opacity: 0.55; }
.inv-h { flex-wrap: wrap; }
.inv-side { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px 12px; margin-left: auto; }
.inv-help { display: flex; align-items: flex-start; gap: 6px; margin-top: 14px; }
.inv-help .ic { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.inv-help .link { font-size: inherit; }

/* Temps de jeu par jour */
.daybars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; align-items: end; height: 130px; }
.daybar { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.daybar-b { flex: 1; width: 100%; max-width: 34px; display: flex; align-items: flex-end; border-radius: 6px; background: var(--bg-900); overflow: hidden; }
.daybar-b i { display: block; width: 100%; height: var(--p, 0%); background: linear-gradient(180deg, var(--gold), var(--orange)); border-radius: 6px 6px 0 0; }
.daybar small { font-size: 11px; color: var(--muted); }

@media (max-width: 900px) {
    .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------ Reglement du site */
.rules-head { display: flex; align-items: flex-start; gap: 16px; }
.rh-ic { width: 48px; height: 48px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--orange-400); }
.rh-ic .ic { width: 24px; height: 24px; }
.rh-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rh-main h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 17px; }
.rh-main b { color: var(--text); font-weight: 600; }
.rh-note { color: var(--text); font-style: italic; }
.rh-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
#rules-draft { align-items: center; flex-wrap: wrap; }
#rules-draft-text { flex: 1; min-width: 220px; }

/* Editeur : barre d'outils, texte et apercu, barre de publication */
.editor { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.ed-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.ed-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.ed-tools button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 38px; height: 38px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color 150ms, color 150ms; }
.ed-tools button:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.ed-tools button:active { background: var(--accent-soft); }
.ed-tools .ic { width: 17px; height: 17px; }
.ed-sep { width: 1px; height: 20px; margin: 0 6px; background: var(--line); }
.editor .seg button { display: inline-flex; align-items: center; gap: 6px; }
.editor .seg .ic { width: 15px; height: 15px; }
.ed-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: clamp(460px, calc(100vh - 300px), 1000px); }
.editor[data-view="write"] .ed-body, .editor[data-view="preview"] .ed-body { grid-template-columns: minmax(0, 1fr); }
.editor[data-view="write"] .ed-preview, .editor[data-view="preview"] .ed-pane { display: none; }
.ed-pane, .ed-preview { position: relative; min-width: 0; min-height: 0; }
.ed-preview { border-left: 1px solid var(--line-soft); background: var(--bg-900); }
.editor[data-view="preview"] .ed-preview { border-left: 0; }
.ed-text { display: block; width: 100%; height: 100%; margin: 0; padding: 16px 18px; resize: none; border: 0; border-radius: 0; background: var(--bg-850); color: var(--text); font: 13.5px/1.75 var(--mono); tab-size: 4; }
.ed-text::placeholder { color: var(--muted); }
.ed-text:focus { outline: none; box-shadow: inset 0 0 0 2px rgba(255, 140, 0, 0.35); }
#rules-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--bg-900); }
.ed-frame-msg { position: absolute; left: 16px; right: 16px; bottom: 16px; padding: 12px 14px; border-radius: var(--r); background: var(--bg-700); border: 1px solid var(--line); font-size: 13.5px; }
.ed-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.ed-state { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.ed-state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.ed-state.is-dirty { color: var(--gold-300); }
.ed-state.is-dirty::before { background: var(--gold); }
.ed-count { flex: 1; font-size: 12.5px; }

/* Sections repliables (aide, texte complet) */
.fold { padding: 0; }
.fold > summary { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 20px; cursor: pointer; list-style: none; font-weight: 700; font-size: 15px; color: var(--text); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .ic { color: var(--orange-400); }
.fold > summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 200ms var(--ease); }
.fold[open] > summary { border-bottom: 1px solid var(--line-soft); }
.fold[open] > summary::after { transform: rotate(-135deg); }
.fold > :not(summary) { margin: 14px 20px; }

/* Repli compact dans une ligne de tableau : le resume est un bouton, pas un
   bandeau, et les formulaires empiles sont separes par un filet. */
.fold.sm { display: inline-block; }
.fold.sm > summary { display: inline-flex; width: auto; min-height: 34px; padding: 0 12px; font-size: 13px; }
.fold.sm > summary::after { content: none; }
.fold.sm[open] > summary { border-bottom: 0; }
.fold.sm > :not(summary) { margin: 10px 0 2px; min-width: 240px; }
.fold.sm > :not(summary) + :not(summary) { padding-top: 10px; border-top: 1px solid var(--line-soft); }

/* Note en tete de la colonne d'actions (joueur hors ligne, serveur muet). */
.side-note { display: flex; gap: 8px; padding: 12px 14px; border-radius: var(--r); background: var(--bg-800); border: 1px solid var(--line-soft); }
.side-note .ic { flex: none; color: var(--muted); }
.side-note b { color: var(--text); }

/* Replis d'actions : le titre garde l'allure d'un en-tete de carte. */
.col-side .fold > summary { font-size: 15.5px; }
.col-side .fold > summary .ic { color: var(--orange-400); }
.col-side .fold[data-hors-ligne] > summary { color: var(--muted); }

/* Bouton de suppression, a droite de l'en-tete d'une fiche. */
.hero-actions { margin-left: auto; align-self: flex-start; }

/* Bouton d'achat d'un lot : il occupe la carte et se replie quand le prix
   barre l'allonge, plutot que de deborder. */
.buy-btn { width: 100%; justify-content: center; flex-wrap: wrap; row-gap: 2px; }
.toolbar .field.inline .field-label { white-space: nowrap; }

/* Ancien prix, barre a cote du prix remise. */
.price-was { margin-left: 8px; opacity: 0.65; font-weight: 500; text-decoration-thickness: 1.5px; }

/* Lot mis en avant dans la boutique du joueur. */
.card.highlight { border-color: var(--orange-700); box-shadow: 0 0 0 1px var(--orange-700) inset; }

/* Articles vises par un code promo (lots, abonnements VIP) : la liste ne s'ouvre
   que pour « Certains articles seulement ». Sans :has (vieux navigateur), elle
   reste visible, et « Toute la boutique » ignore les cases cochees. */
.promo-cible .check { min-height: 32px; }
/* Libelle long a cote d'une case : il passe a la ligne au lieu de deborder (mobile). */
.check.wrap { white-space: normal; }
.promo-lots { display: flex; flex-direction: column; gap: 6px; padding-left: 26px; }
.promo-cases { display: flex; flex-wrap: wrap; gap: 0 18px; }
.promo-cible:has(input[value="tout"]:checked) .promo-lots { display: none; }

.help-table code { padding: 2px 6px; border-radius: 5px; background: var(--bg-900); color: var(--gold-300); font: 12.5px var(--mono); white-space: nowrap; }
.help-table td:first-child { white-space: nowrap; }
.rules-raw { max-height: 520px; overflow: auto; padding: 14px 16px; border-radius: var(--r); background: var(--bg-900); color: var(--text-2); font: 12.5px/1.65 var(--mono); white-space: pre-wrap; word-break: break-word; }
.card-note.pad { padding: 10px 20px 14px; border-top: 1px solid var(--line-soft); }

/* Comparaison de deux versions */
.diff-wrap { overflow: auto; }
.diff-wrap.boxed { max-height: 46vh; border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--bg-900); }
.diff-wrap .empty { text-align: center; }
.diff { width: 100%; border-collapse: collapse; font: 12.5px/1.6 var(--mono); }
.diff td { padding: 1px 10px; vertical-align: top; }
.diff .d-n { width: 1%; text-align: right; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; user-select: none; }
.diff .d-s { width: 1%; padding: 1px 4px; text-align: center; font-weight: 700; user-select: none; }
.diff .d-t { white-space: pre-wrap; word-break: break-word; color: var(--text-2); }
.diff .d-add td { background: rgba(60, 179, 113, 0.12); }
.diff .d-add .d-t, .diff .d-add .d-s { color: #a6ecc2; }
.diff .d-del td { background: rgba(230, 57, 70, 0.12); }
.diff .d-del .d-t, .diff .d-del .d-s { color: #ffb3b9; }
.diff .d-skip td { padding: 6px 12px; text-align: center; color: var(--muted); font: 12px var(--font); background: var(--bg-850); border-block: 1px solid var(--line-soft); }
.modal.wide { width: min(880px, calc(100vw - 32px)); }

@media (max-width: 1100px) {
    .ed-body { height: 70vh; }
    .editor[data-view="split"] .ed-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: 55vh 70vh; height: auto; }
    .editor[data-view="split"] .ed-preview { border-left: 0; border-top: 1px solid var(--line-soft); }
}
@media (max-width: 640px) {
    .ed-tools button span { display: none; }
    .rules-head { flex-wrap: wrap; }
    .rh-actions { width: 100%; }
    .ed-foot .btn-row { width: 100%; }
    .ed-foot .btn-row .btn { flex: 1; }
}

/* Abonnement VIP (page /vip) */
/* Meme principe que .char-grid : deux paliers de 320 a 560 px, cote a cote
   des 1366 px, l'un sous l'autre sur mobile. Les deux cartes ont la meme
   hauteur et leurs boutons s'alignent en bas. */
.vip-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.vip-plan { flex: 1 1 320px; max-width: 560px; display: flex; flex-direction: column; gap: 14px; padding: 22px 22px 20px; }
.vip-plan .vip-perks { flex: 1; }
.vip-plan .card-h { margin-bottom: 0; }
.vip-plan .card-h h2 { font: 400 34px/1 var(--font-display); letter-spacing: 0.04em; }
.vip-price { display: flex; align-items: baseline; gap: 8px; }
.vip-price b { font: 400 46px/1 var(--font-display); letter-spacing: 0.02em; color: var(--gold); font-variant-numeric: tabular-nums; }
.vip-price span { color: var(--muted); font-size: 14px; }
.vip-perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.vip-perks li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--text-2); }
.vip-perks .ic { width: 17px; height: 17px; margin-top: 2px; color: var(--ok); flex-shrink: 0; }
.vip-why { padding: 10px 12px; border-radius: var(--r); background: var(--bg-850); border: 1px solid var(--line-soft); }
.vip-actions { display: flex; flex-direction: column; gap: 8px; }
.vip-actions > p { margin: 0; }
.vip-current { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.vip-current .card-h { margin-bottom: 0; }
.vip-current .sub-h { margin: 6px 0 0; }
.vip-current .note { margin: 0; }
.vip-facts { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 1134px; }
.vip-facts li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-card); background: var(--bg-800); border: 1px solid var(--line-soft); font-size: 13.5px; }
.vip-facts .ic { width: 20px; height: 20px; flex-shrink: 0; color: var(--orange-400); margin-top: 1px; }
.vip-facts b { display: block; color: var(--text); margin-bottom: 2px; }
@media (max-width: 900px) {
    .vip-grid, .vip-facts { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------ Boutique : depenses et benefice */
.fin-period { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.fin-period .toolbar input[type="date"] { width: auto; }
.fin-period-label { font-size: 14px; color: var(--text-2); }
.fin-period-label b { color: var(--text); }
.stat.fin-profit.pos .stat-ic { background: rgba(60, 179, 113, 0.14); color: var(--ok); }
.stat.fin-profit.pos .stat-value { color: #7ddba4; }
.stat.fin-profit.neg .stat-ic { background: rgba(230, 57, 70, 0.14); color: var(--err); }
.stat.fin-profit.neg .stat-value { color: #ff9aa2; }
.fin-table td { padding-top: 9px; padding-bottom: 9px; }
.fin-table .fin-sub td { font-weight: 700; color: var(--text); border-top: 1px solid var(--line); }
.fin-total td { font-weight: 700; font-size: 15px; color: var(--text); border-top: 2px solid var(--line); }
.fin-gap { margin-top: 14px; }
.fin-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.fin-legend i { width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.fin-legend .lg-in, .monthbar-b i.in { background: linear-gradient(180deg, var(--gold), var(--orange)); }
.fin-legend .lg-out, .monthbar-b i.out { background: rgba(230, 57, 70, 0.7); }
.monthbars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; height: 150px; margin-bottom: 16px; }
.monthbar { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.monthbar-b { flex: 1; width: 100%; max-width: 44px; display: flex; align-items: flex-end; gap: 3px; padding: 0 2px; border-radius: 6px; background: var(--bg-900); }
.monthbar-b i { display: block; flex: 1; height: var(--p, 0%); border-radius: 4px 4px 0 0; }
.monthbar small { font-size: 11px; color: var(--muted); }

/* Statistiques des ventes (Boutique) : une couleur par categorie. */
.cat-vip { --c: #FFC107; }
.cat-vip_plus { --c: #FF8C00; }
.cat-packs { --c: #3CB371; }
.cat-appartement { --c: #4FA3D1; }
.cat-lootbox { --c: #B084F5; }
.cat-vehicule { --c: #E86A5A; }
.cat-objet { --c: #9AA0A6; }
.cat-autre { --c: #6B6F76; }
.sales-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--muted)); }
.sales-cat { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; color: var(--text); white-space: nowrap; }
.sales-share { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.sales-share-b { flex: 1; height: 8px; border-radius: 9999px; background: var(--bg-900); overflow: hidden; }
.sales-share-b i { display: block; height: 100%; width: var(--p, 0%); border-radius: inherit; background: var(--c, var(--orange)); }
.sales-share small { flex: none; width: 46px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.stat-value.sales-top { font-size: 17px; line-height: 1.35; white-space: normal; }
.stackbars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; align-items: end; height: 170px; }
.stackbars.dense { gap: 3px; }
.stackbar { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.stackbar-b { flex: 1; width: 100%; max-width: 40px; display: flex; flex-direction: column-reverse; border-radius: 6px; background: var(--bg-900); overflow: hidden; }
.stackbar-b i { display: block; flex: none; width: 100%; height: var(--p, 0%); background: var(--c); }
.stackbar-b i + i { box-shadow: 0 1px 0 rgba(13, 8, 6, 0.55); }
.stackbar small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.stackbars.dense .stackbar small { font-size: 9.5px; }
.stackbar:hover .stackbar-b { background: var(--bg-700); box-shadow: inset 0 0 0 1px var(--line); }
.sales-tip { position: fixed; z-index: 60; min-width: 230px; }
.sales-tip .sales-tip-total { color: var(--text-2); margin-bottom: 6px; }
.sales-tip .sales-tip-none { color: var(--muted); }
.sales-tip .sales-tip-row { display: grid; grid-template-columns: 8px 1fr auto; column-gap: 8px; align-items: center; padding: 3px 0; }
.sales-tip .sales-tip-row em { font-style: normal; color: var(--text-2); }
.sales-tip .sales-tip-row strong { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.sales-tip .sales-tip-row small { grid-column: 2 / -1; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.sales-tip .sales-tip-sum { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-soft); color: var(--text-2); font-variant-numeric: tabular-nums; }
.sales-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.sales-legend span { display: inline-flex; align-items: center; gap: 7px; }
.sales-note { margin-top: 12px; line-height: 1.6; }
.sales-note b { color: var(--text-2); }
@media (max-width: 560px) {
    .stackbars { gap: 2px; height: 130px; }
    .stackbar small { font-size: 9px; }
    .stackbars.dense .stackbar:nth-child(even) small { visibility: hidden; }
}
.table tfoot td { border-bottom: 0; }
/* Formulaire de modification dans une ligne : une seule colonne, et pas
   l'alignement a droite ni le « nowrap » de la colonne d'actions. */
.fold.sm .grid-2 { grid-template-columns: 1fr; gap: 12px; }
.fold.sm > form.stack { min-width: 300px; max-width: 360px; }
.table .actions .fold.sm > form { text-align: left; white-space: normal; }
@media (max-width: 560px) {
    .monthbars { gap: 3px; height: 120px; }
    .monthbar small { font-size: 9.5px; }
    .fin-period .toolbar { width: 100%; }
}

/* ------------------------------------------------------------ Gangs */
/* Couleur du gang : data-color -> --role (app.js). */
.gang-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--role, var(--muted)); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1); }
.gang-chip { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--text); text-decoration: none; white-space: nowrap; }
a.gang-chip:hover { text-decoration: underline; }
.avatar.gang-av { border: 2px solid var(--role, var(--line)); color: var(--text); }
.chips-inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.chips-inline small { margin-right: 6px; }
.feed.pad-x { padding: 0 20px; }
.card.flush .pad-note { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-soft); }
.clip { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge .ic { width: 12px; height: 12px; }
.perm-pills { gap: 4px; }
.perm-pills .pill { padding: 2px 8px; font-size: 12px; }

/* Whitelist : etat du site Verify (ouvert / ferme) */
.verify-state { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.verify-state-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.verify-state h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15.5px; font-weight: 700; }
.verify-state h2 .ic { color: var(--orange-400); }
.verify-state.is-closed { border-color: rgba(230, 57, 70, 0.45); }
.verify-state.is-closed h2 .ic { color: #ff8a93; }

/* Entreprises : entrees / sorties du compte sur 14 jours, chips dans une carte */
.monthbars.days14 { grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; }
.chips.pad-x { padding: 0 20px 12px; }

/* ------------------------------------------------------------ Shield (proxys anti-DDoS) */
@media (min-width: 1201px) { .shield-layout { grid-template-columns: minmax(0, 1fr) 400px; } }
.shield-health { display: flex; flex-wrap: wrap; gap: 10px; }
.mono-ip { font-family: var(--mono); font-size: 13px; color: var(--text); }
.ev-attack { color: #ff8a93; }
.shield-table tr.row-attacked td { background: rgba(230, 57, 70, 0.06); }
.shield-table th { position: relative; } /* garde le libellé masqué « Actions » dans la zone qui défile */
.shield-cap { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; padding: 4px 6px; margin: -4px -6px; border: 0; border-radius: var(--r); background: transparent; color: inherit; cursor: pointer; }
.shield-cap:hover { background: rgba(255, 255, 255, 0.05); }
.shield-cap .ic { width: 14px; height: 14px; color: var(--muted); transform: rotate(90deg); }
.shield-cap[aria-expanded="true"] .ic { transform: rotate(-90deg); }
.shield-players-row td { background: var(--bg-850); padding-top: 12px; padding-bottom: 14px; }
.shield-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.shield-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 10px; border-radius: 9999px; border: 1px solid var(--line-soft); background: var(--bg-800); color: var(--text); font-size: 13px; text-decoration: none; }
a.shield-chip:hover { border-color: var(--orange-700); }
.shield-chip small { color: var(--muted); font-size: 12px; }
.shield-chip.off { opacity: 0.7; }
.shield-chip.unknown { border-style: dashed; color: var(--text-2); }
.shield-sid { color: var(--orange-400); font-variant-numeric: tabular-nums; }
.shield-cap-bar { width: 90px; height: 7px; border-radius: 4px; background: var(--bg-700); overflow: hidden; flex-shrink: 0; }
.shield-cap-bar span { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--gold), var(--orange)); }
.shield-cap-bar.err span { background: var(--err); }
.shield-cap b { color: var(--text); font-variant-numeric: tabular-nums; }
.shield-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12.5px; color: var(--muted); }
.shield-legend span::before { content: ''; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: var(--orange); }
.shield-legend .lg-proxies::before { background: var(--info); }
.shield-legend .lg-attack::before { background: var(--err); }
.shield-chart { position: relative; min-height: 200px; }
.shield-chart svg { display: block; width: 100%; height: 200px; }
.shield-chart .ax { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.shield-chart .ax-p { fill: #7fbde0; }
.shield-chart .hover-line { stroke: rgba(255, 255, 255, 0.25); stroke-dasharray: 3 3; }
.shield-chart .chart-tip .tip-attack { color: #ff8a8f; white-space: normal; max-width: 280px; margin-top: 4px; }
.shield-settings { display: flex; flex-direction: column; }
.shield-settings .set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; color: var(--text); cursor: pointer; }
.shield-settings .set-row small { display: block; color: var(--muted); font-size: 12.5px; }
.shield-settings .btn { margin-top: 14px; width: 100%; }
.num-unit { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.shield-settings input.num-in { flex: 0 0 auto; width: 76px; min-height: 36px; padding: 0 6px; text-align: center; font-weight: 700; }
.switch-in { appearance: none; -webkit-appearance: none; position: relative; flex-shrink: 0; width: 40px; height: 22px; margin: 0; border-radius: 11px; border: 1px solid var(--line); background: var(--bg-700); cursor: pointer; transition: background-color 150ms; }
.switch-in::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform 150ms var(--ease), background-color 150ms; }
.switch-in:checked { border-color: transparent; background: linear-gradient(135deg, var(--gold), var(--orange)); }
.switch-in:checked::after { transform: translateX(18px); background: var(--on-accent); }
.shield-feed li { font-size: 13px; }
.shield-ev { display: flex; gap: 10px; min-width: 0; }
.shield-lvl { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 7px; background: var(--info); }
.shield-lvl.warn { background: var(--warn); }
.shield-lvl.error { background: var(--err); }
.shield-lvl.attack { background: var(--err); box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.18); }
.shield-sus-wrap { max-height: 60vh; overflow-y: auto; }
.shield-sus-who { display: flex; align-items: center; gap: 8px; }
.shield-bill { font-size: 13.5px; gap: 7px 14px; }
.shield-bill dd { text-align: right; font-variant-numeric: tabular-nums; }
.shield-bill dd.shield-topay { color: var(--gold-300); font-weight: 700; }
.shield-bill dd.shield-free { color: #7ddba4; font-weight: 700; }
.shield-bill-foot { margin-top: 10px; }
