/* ===== TDPNet — espace client (thème bordeaux sombre) ===== */

:root {
  --bg: #22040d;
  --sidebar: #2c0611;
  --surface: #330915;
  --surface-2: #3f0d1b;
  --border: rgba(242, 232, 213, .1);
  --border-strong: rgba(242, 232, 213, .2);
  --cream: #f2e8d5;
  --text: #f2e8d5;
  --muted: rgba(242, 232, 213, .62);
  --red: #b01e3e;
  --red-dark: #8f1631;
  --red-light: #e2687f;
  --green: #7fd6a4;
  --orange: #f0b46a;
  --radius: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-title: "Montserrat", var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--red-light); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-title); line-height: 1.25; margin: 0 0 .4em; font-weight: 700; }
p { margin: 0 0 1em; }
code, pre { font-family: ui-monospace, "JetBrains Mono", Consolas, monospace; }

.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ===== Logo (repris du site) ===== */
.logo__mark { width: 46px; height: auto; }
.logo__cream { fill: var(--cream); }
.logo__red { fill: var(--red); }
.logo__text { font-family: var(--font-title); font-weight: 800; font-size: 1.25rem; color: var(--cream); }
.logo__text span { color: var(--red); }

/* ===== Structure ===== */

.panel { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }

.sidebar { background: var(--sidebar); border-right: 1px solid var(--border); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar__logo { display: flex; align-items: center; gap: .55rem; padding: 4px 10px 22px; text-decoration: none !important; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar__nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; text-decoration: none; }
.sidebar__nav a:hover { background: var(--surface); color: var(--cream); }
.sidebar__nav a.is-active { background: var(--red); color: #fff; }
.sidebar__title { margin: 18px 12px 6px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: rgba(242, 232, 213, .45); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; margin: 14px 24px 0; padding: 10px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.topbar__burger { display: none; width: 40px; height: 40px; padding: 9px; border: 0; background: none; cursor: pointer; }
.topbar__burger span { display: block; height: 2px; margin: 4px 0; background: var(--cream); border-radius: 2px; }
.topbar__user { font-weight: 600; }

.sim-badge { margin-left: auto; padding: .25em .7em; border-radius: 999px; font-size: .75rem; font-weight: 600; color: var(--orange); background: rgba(240, 180, 106, .12); border: 1px solid rgba(240, 180, 106, .3); white-space: nowrap; }

.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 700; }

.content { flex: 1; padding: 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-bottom: 22px; }
.page-head h1 { font-size: 1.5rem; font-weight: 600; margin: 0; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.crumbs .icon { width: 16px; height: 16px; }

.panel-footer { padding: 18px 24px; color: var(--muted); font-size: .85rem; }

/* ===== Menus déroulants ===== */

.dropdown { position: relative; }
.dropdown summary { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; cursor: pointer; list-style: none; font-weight: 500; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .7; }
.dropdown summary:hover { background: var(--surface-2); }
.dropdown__menu { position: absolute; top: calc(100% + 8px); left: 0; min-width: 230px; padding: 6px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .6); z-index: 30; }
.dropdown__menu--right { left: auto; right: 0; }
.dropdown__menu a, .dropdown__menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: none; color: var(--cream); font: inherit; text-align: left; cursor: pointer; text-decoration: none; }
.dropdown__menu a:hover, .dropdown__menu button:hover { background: var(--surface); }
.dropdown__menu form { margin: 0; }
.dropdown__add { border-top: 1px solid var(--border) !important; margin-top: 4px; color: var(--green) !important; }

/* ===== Boutons ===== */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: .7em 1.2em; border-radius: 8px; border: 1px solid transparent; font: 600 .92rem var(--font); cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s; }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-dark); }
.btn--ghost { background: transparent; border-color: var(--border-strong); color: var(--cream); }
.btn--ghost:hover { border-color: var(--cream); }
.btn--danger { background: transparent; border-color: rgba(226, 104, 127, .5); color: var(--red-light); }
.btn--danger:hover { background: rgba(226, 104, 127, .1); }
.btn--sm { padding: .45em .9em; font-size: .85rem; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, .sidebar__nav a:focus-visible { outline: 2px solid var(--red-light); outline-offset: 2px; }

/* ===== Blocs ===== */

.box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 22px; }
.box__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.box__head h2 { font-size: 1.35rem; margin: 0; }
.box__head p { margin: .2em 0 0; color: var(--muted); }
.box h3 { font-size: 1.05rem; }

.hello { margin-bottom: 22px; }
.hello h2 { font-size: 1.6rem; font-weight: 600; margin-bottom: .1em; }
.hello p { color: var(--muted); margin: 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat small { display: block; color: var(--muted); font-size: .9rem; margin-bottom: 6px; }
.stat strong { font-family: var(--font-title); font-size: 1.6rem; font-weight: 700; }
.stat strong.ok { color: var(--green); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

/* Cartes de services */
.services { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.service-card { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 200px; padding: 22px; background: var(--surface); border: 1px solid var(--border); border-bottom: 3px solid var(--red); border-radius: var(--radius); color: var(--cream); text-decoration: none !important; transition: border-color .15s, transform .15s; }
.service-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.service-card__icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--surface-2); color: var(--cream); margin-bottom: 12px; }
.service-card strong { font-family: var(--font-title); font-size: 1.25rem; }
.service-card small { color: var(--muted); }
.service-card .status { position: absolute; top: 22px; right: 22px; }
.service-card--add { align-items: center; justify-content: center; border-bottom-width: 1px; border-style: dashed; color: var(--muted); font-weight: 600; font-size: 1.05rem; }
.service-card--add .icon { width: 34px; height: 34px; color: var(--green); }

/* Statuts */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status--en-ligne { color: var(--green); }
.status--installation { color: var(--orange); }

.tag { display: inline-block; padding: .15em .6em; border-radius: 6px; background: var(--surface-2); font-size: .78rem; font-weight: 600; color: var(--muted); }
.tag--red { background: rgba(226, 104, 127, .15); color: var(--red-light); }
.tag--green { background: rgba(127, 214, 164, .12); color: var(--green); }

/* ===== Choix (création de service) ===== */

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice__body { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 20px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface-2); transition: border-color .15s, background .15s; }
.choice__body strong { font-family: var(--font-title); font-size: 1.05rem; }
.choice__body small { color: var(--muted); }
.choice__price { font-family: var(--font-title); font-weight: 700; color: var(--cream); margin-top: 6px; }
.choice input:checked + .choice__body { border-color: var(--red-light); background: rgba(176, 30, 62, .18); }
.choice input:focus-visible + .choice__body { outline: 2px solid var(--red-light); outline-offset: 2px; }
.choice .icon { width: 30px; height: 30px; margin-bottom: 8px; }

.step-title { font-size: 1rem; margin: 26px 0 12px; color: var(--muted); font-family: var(--font); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.step-title:first-child { margin-top: 0; }

/* ===== Formulaires ===== */

.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
.form small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: .7em .85em; font: 400 .95rem var(--font); color: var(--cream);
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 8px;
}
select option { background: var(--surface-2); }
textarea { resize: vertical; }
.check { display: flex !important; align-items: center; gap: 10px; font-weight: 500 !important; }
.check input { flex: none; width: 17px; height: 17px; accent-color: var(--red); }
.check:has(span) { align-items: flex-start; }
.check:has(span) input { margin-top: 3px; }
.check span { line-height: 1.5; }
.inline-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.inline-form select { min-width: 170px; padding: .45em .6em; }
.form--inline { grid-template-columns: 2fr 1fr 2fr auto; align-items: end; margin-bottom: 20px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding-top: 8px; }

/* Lignes de réglage façon TCPShield */
.setting { display: grid; grid-template-columns: 1fr minmax(220px, 340px); align-items: center; gap: 12px 24px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.setting:last-of-type { border-bottom: 0; }
.setting h3 { margin: 0; font-size: 1.05rem; }
.setting p { margin: .15em 0 0; color: var(--muted); font-size: .9rem; }
.setting__control { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.setting__control output { min-width: 60px; text-align: right; font-weight: 600; color: var(--muted); }
input[type=range] { width: 100%; accent-color: var(--red); }

/* Interrupteur */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--bg); border: 1px solid var(--border-strong); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--cream); transition: transform .15s; }
.switch input:checked + span { background: var(--red); border-color: var(--red); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--red-light); outline-offset: 2px; }
.switch input:disabled + span { opacity: .45; }

/* Sous-menu vertical (onglets à gauche) */
.with-subnav { display: grid; grid-template-columns: 180px 1fr; gap: 22px; align-items: start; }
.subnav { display: flex; flex-direction: column; gap: 2px; }
.subnav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-right: 2px solid transparent; color: var(--muted); font-weight: 500; text-decoration: none; }
.subnav a:hover { color: var(--cream); }
.subnav a.is-active { color: var(--red-light); border-right-color: var(--red-light); }

/* ===== Tableaux ===== */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; padding: 12px 14px; background: var(--bg); color: var(--muted); font-weight: 600; white-space: nowrap; }
th:first-child { border-radius: 8px 0 0 8px; }
th:last-child { border-radius: 0 8px 8px 0; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* Matrice de permissions */
.perms th, .perms td { text-align: center; }
.perms th:first-child, .perms td:first-child { text-align: left; }
.perms input { width: 18px; height: 18px; accent-color: var(--red); }

/* ===== Messages ===== */

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; }
.alert p { margin: 0; }
.alert--success { background: rgba(127, 214, 164, .12); border: 1px solid rgba(127, 214, 164, .3); color: var(--green); }
.alert--error { background: rgba(226, 104, 127, .12); border: 1px solid rgba(226, 104, 127, .35); color: var(--red-light); }
.alert--info { background: rgba(240, 180, 106, .1); border: 1px solid rgba(240, 180, 106, .3); color: var(--orange); }

.locked { padding: 18px 20px; border: 1px dashed rgba(226, 104, 127, .45); border-radius: var(--radius); background: rgba(176, 30, 62, .08); }
.locked strong { color: var(--red-light); }
.locked p { margin: .3em 0 0; color: var(--muted); }

/* ===== Code ===== */

.code { position: relative; }
.code pre { margin: 0; padding: 18px 96px 18px 18px; max-height: 420px; overflow: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-size: .82rem; line-height: 1.6; color: var(--cream); }
.code__copy { position: absolute; top: 10px; right: 10px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-all; }

/* ===== Graphiques ===== */

.chart { width: 100%; height: auto; display: block; }
.chart__grid { stroke: var(--border); stroke-width: 1; }
.chart__axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart__unit { fill: var(--muted); font-size: 11px; font-family: var(--font); dominant-baseline: hanging; }
.chart__line { fill: none; stroke: var(--red-light); stroke-width: 2.2; stroke-linejoin: round; }
.chart__area { fill: rgba(226, 104, 127, .12); }

.bars { display: grid; gap: 12px; }
.bar { display: grid; grid-template-columns: 140px 1fr 56px; align-items: center; gap: 12px; font-size: .9rem; }
.bar__track { height: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 999px; background: var(--red-light); }
.bar span:last-child { text-align: right; color: var(--muted); }

.periods { display: flex; flex-wrap: wrap; gap: 6px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.toolbar .hello { margin: 0; }

/* ===== Connexion / inscription ===== */

.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.auth { width: 100%; max-width: 420px; }
.auth__logo { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-bottom: 24px; text-decoration: none !important; }
.auth__card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 32px; }
.auth__card h1 { font-size: 1.5rem; }
.auth__sub { color: var(--muted); }
.auth__switch { margin: 18px 0 0; text-align: center; color: var(--muted); }

/* ===== Responsive ===== */

@media (max-width: 1200px) {
  .with-subnav { grid-template-columns: 1fr; gap: 14px; }
  .subnav { flex-direction: row; overflow-x: auto; border-bottom: 1px solid var(--border); }
  .subnav a { border-right: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
  .subnav a.is-active { border-bottom-color: var(--red-light); }
}

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .panel { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.is-open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .5); }
  .topbar { margin: 10px 12px 0; padding: 8px 10px; }
  .topbar__burger { display: block; }
  .topbar__user { display: none; }
  .content { padding: 18px 12px; }
  .grid-2, .form--inline { grid-template-columns: 1fr; }
  .setting { grid-template-columns: 1fr; }
  .setting__control { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .sim-badge { display: none; }
  .bar { grid-template-columns: 90px 1fr 46px; }
  .box { padding: 18px; }
}

/* ===== Serveurs de jeu ===== */

.status--running { color: var(--green); }
.status--starting, .status--stopping, .status--installing { color: var(--orange); }
.status--offline { color: var(--muted); }
.status--suspended { color: var(--red-light); }

.game-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.game-head h2 { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; font-weight: 600; margin: 0 0 .15em; }
.game-head p { margin: 0; color: var(--muted); }
.power { display: flex; flex-wrap: wrap; gap: 8px; }
.btn--start { background: #2f8f5b; color: #fff; }
.btn--start:hover { background: #26784b; }
.btn .icon { width: 16px; height: 16px; }

.live-stats { display: grid; gap: 14px; align-content: start; }
.live-stats--row { grid-template-columns: repeat(4, 1fr); margin-bottom: 22px; }
.live-stats .stat strong { font-size: 1.05rem; display: block; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.meter { display: block; height: 6px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--red-light); transition: width .4s; }

.console-layout { display: grid; grid-template-columns: 1fr 260px; gap: 20px; align-items: start; }
.console-box { padding: 0; overflow: hidden; }
.console { height: 460px; overflow-y: auto; padding: 16px 18px; background: #12020a; font: .82rem/1.55 ui-monospace, "JetBrains Mono", Consolas, monospace; color: #e8dcc8; white-space: pre-wrap; word-break: break-word; }
.console__tdp { color: var(--orange); }
.console__cmd { color: var(--red-light); }
.console__form { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.console__form span { color: var(--muted); font-family: ui-monospace, monospace; }
.console__form input { flex: 1; border: 0; background: transparent; padding: .5em 0; font-family: ui-monospace, monospace; }
.console__form input:focus-visible { outline: none; }

.shortcuts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.shortcuts a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--cream); font-weight: 500; text-decoration: none; }
.shortcuts a:hover { border-color: var(--border-strong); }

.kv--spaced { margin-top: 18px; }
.form--spaced { margin-top: 16px; }
.form--grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.form--db { grid-template-columns: 2fr 2fr auto; }

/* Fichiers */
.path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-family: ui-monospace, monospace; font-size: .9rem; }
.path span { color: var(--muted); }
.file-tools { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-bottom: 16px; }
.file-tools input[type=text] { width: 180px; padding: .45em .6em; }
.file-tools input[type=file] { max-width: 220px; font-size: .85rem; color: var(--muted); }
.files__name { display: inline-flex; align-items: center; gap: 8px; color: var(--cream); }
.files__name .icon { color: var(--orange); }
.files td:last-child:not([colspan]) { width: 110px; text-align: right; }
.dropdown--row summary { display: inline-flex; padding: 4px 10px; border: 1px solid var(--border-strong); border-radius: 6px; font-size: .82rem; }
.dropdown__form { display: grid; gap: 6px; padding: 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown__form input { padding: .4em .5em; font-size: .85rem; }
.dropdown__menu .danger { color: var(--red-light); }
.editor textarea { width: 100%; min-height: 460px; font: .85rem/1.55 ui-monospace, "JetBrains Mono", Consolas, monospace; background: #12020a; tab-size: 4; }

/* Bases de données */
.db-card { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); margin-bottom: 14px; }
.db-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.db-card__head strong { display: flex; align-items: center; gap: 8px; font-family: ui-monospace, monospace; }
.secret { margin-right: 8px; }

.choice--off { opacity: .45; cursor: not-allowed; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; max-width: 360px; padding: 12px 16px; border-radius: 8px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.toast--error { background: #5a1022; border: 1px solid var(--red-light); color: #fff; }

@media (max-width: 1100px) {
  .live-stats--row { grid-template-columns: repeat(2, 1fr); }
  .console-layout { grid-template-columns: 1fr; }
  .console-layout .live-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .form--db { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .live-stats--row, .console-layout .live-stats, .shortcuts { grid-template-columns: 1fr; }
  .console { height: 360px; }
  .game-head h2 { font-size: 1.25rem; }
}
@media (max-width: 560px) {
  .files th:nth-child(3), .files td:nth-child(3):not([colspan]) { display: none; }
}
.eula { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.eula p { margin: 0; }
.muted-note { color: var(--muted); font-size: .9rem; margin: 12px 0 0; }

/* =====================================================================
   Thème « console » inspiré de TCPShield, aux couleurs TDPNet
   (cartes sombres en relief, menu actif lumineux, boutons en pilule)
   ===================================================================== */

:root {
  --bg: #231a1e;
  --sidebar: #1b1316;
  --surface: #1b1316;
  --surface-2: #2b2024;
  --border: rgba(242, 232, 213, .07);
  --border-strong: rgba(242, 232, 213, .16);
  --red: #c4264a;
  --red-dark: #a51e3d;
  --red-light: #ec6a83;
  --glow: rgba(196, 38, 74, .55);
  --line: rgba(196, 38, 74, .45);
  --shadow: 0 4px 24px rgba(0, 0, 0, .28);
  --radius: 8px;
  --font: "Montserrat", "Inter", system-ui, sans-serif;
}

body { font-size: 15px; letter-spacing: .01em; }
h1, h2, h3 { font-weight: 500; letter-spacing: 0; }

/* Menu latéral */
.sidebar { border-right: 0; box-shadow: 0 0 15px rgba(0, 0, 0, .35); padding: 22px 16px; }
.sidebar__logo { padding: 0 10px 28px; }
.sidebar__logo .logo__mark { width: 50px; }
.sidebar__nav a { padding: 11px 15px; border-radius: 6px; font-weight: 500; font-size: .93rem; transition: background .15s, color .15s, padding .15s; }
.sidebar__nav a:hover { background: rgba(242, 232, 213, .04); padding-left: 19px; }
.sidebar__nav a.is-active { background: linear-gradient(118deg, var(--red), rgba(196, 38, 74, .72)); box-shadow: 0 0 10px 1px var(--glow); color: #fff; padding-left: 15px; }
.sidebar__title { margin: 22px 15px 8px; font-size: .7rem; letter-spacing: .1em; color: rgba(242, 232, 213, .4); }

/* Barre du haut */
.topbar { margin: 16px 28px 0; padding: 12px 20px; background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.dropdown summary { font-size: 1.02rem; }
.dropdown__menu { background: #241a1e; border-color: var(--border); box-shadow: var(--shadow); }
.avatar { width: 38px; height: 38px; background: linear-gradient(118deg, var(--red), var(--red-light)); box-shadow: 0 0 8px var(--glow); }

/* Contenu */
.content { padding: 28px; }
.page-head { margin-bottom: 26px; gap: 8px 28px; }
.page-head h1 { font-size: 1.65rem; font-weight: 400; }
.crumbs { font-size: .92rem; }
.crumbs a { color: var(--red-light); }
.crumbs span:not(:last-child) { color: rgba(242, 232, 213, .5); }

.hello h2, .game-head h2 { font-size: 1.85rem; font-weight: 400; }
.hello p { font-weight: 500; }

/* Cartes */
.box, .stat, .service-card, .db-card { background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.box { padding: 28px 32px; margin-bottom: 26px; }
.box__head { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 22px; }
.box__head h2 { font-size: 1.9rem; font-weight: 600; }
.box__head p { font-size: .98rem; color: rgba(242, 232, 213, .78); }
.box .box { box-shadow: none; background: var(--surface-2); }
.stat { padding: 22px 24px; }
.stat small { font-size: 1.02rem; color: rgba(242, 232, 213, .82); margin-bottom: 10px; }
.stat strong { font-size: 1.75rem; }
.stats, .live-stats--row { gap: 26px; }
.grid-2 { gap: 26px; }

.service-card { min-height: 220px; padding: 24px; border-bottom: 3px solid var(--red); }
.service-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0, 0, 0, .4), 0 0 0 1px var(--line); }
.service-card__icon { background: var(--surface-2); color: var(--red-light); }
.service-card strong { font-size: 1.45rem; font-weight: 700; }
.service-card--add { border-bottom-width: 0; box-shadow: var(--shadow); color: rgba(242, 232, 213, .85); font-size: 1.25rem; font-weight: 500; }
.service-card--add .icon { width: 38px; height: 38px; color: #4fd38b; }

/* Boutons en pilule */
.btn { border-radius: 2rem; padding: .7em 1.5em; font-family: var(--font); font-weight: 500; letter-spacing: .02em; }
.btn--sm { padding: .5em 1.15em; }
.btn--pill { padding: .8em 2em; font-size: 1.05rem; }
.btn--primary { background: var(--red); box-shadow: 0 0 0 transparent; transition: box-shadow .2s, background .2s; }
.btn--primary:hover { background: var(--red); box-shadow: 0 8px 25px -8px var(--red); }
.btn--ghost { border-color: var(--border-strong); background: transparent; }
.btn--ghost:hover { border-color: var(--red-light); color: var(--red-light); }
.btn--danger { border-color: rgba(236, 106, 131, .45); }
.btn--start { background: #2a9a62; }
.btn--start:hover { box-shadow: 0 8px 25px -8px #2a9a62; }

/* Champs remplis, sans bordure */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], select, textarea {
  background: var(--surface-2); border: 1px solid transparent; border-radius: 8px; padding: .8em 1em; font-family: var(--font);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 3px 10px rgba(0, 0, 0, .25); }
.form label { font-weight: 500; }

/* Réglages ligne par ligne */
.setting { padding: 22px 0; }
.setting h3 { font-size: 1.3rem; font-weight: 600; }
.setting p { font-size: .92rem; }

/* Interrupteurs compacts */
.switch { width: 44px; height: 24px; }
.switch span { background: var(--surface-2); border-color: transparent; }
.switch span::after { width: 18px; height: 18px; top: 2px; left: 3px; background: #f4ece0; }
.switch input:checked + span { background: var(--red); box-shadow: 0 0 8px var(--glow); }

/* Onglets horizontaux (pare-feu…) */
.tabs-line { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: -6px 0 24px; border-bottom: 1px solid var(--line); }
.tabs-line a { display: flex; align-items: center; gap: 8px; padding: 12px 14px; color: rgba(242, 232, 213, .85); font-weight: 500; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs-line a:hover { color: #fff; }
.tabs-line a.is-active { color: var(--red-light); border-bottom-color: var(--red-light); }
.tabs-line .icon { width: 17px; height: 17px; }

/* Sous-menu vertical */
.subnav a { font-weight: 500; padding: 11px 14px; }
.subnav a.is-active { color: var(--red-light); border-right-color: var(--red-light); }

/* Tableaux */
th { background: #140d10; color: rgba(242, 232, 213, .85); font-weight: 600; padding: 14px 16px; }
td { padding: 14px 16px; border-bottom-color: var(--border); }
tbody tr:hover td { background: rgba(242, 232, 213, .02); }
.empty { color: rgba(242, 232, 213, .78); }
.rule-note { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.rule-form { padding: 18px; margin-bottom: 22px; border-radius: var(--radius); background: var(--surface-2); }
.rule-form input, .rule-form select { background: var(--bg); }

/* Étiquettes et messages */
.tag { border-radius: 999px; padding: .2em .8em; }
.alert { border-radius: var(--radius); }
.locked { border-radius: var(--radius); }

/* Console */
.console { background: #110b0d; }
.console-box { background: var(--surface); }

/* Connexion / inscription */
.auth__card { background: var(--surface); border: 0; box-shadow: var(--shadow); border-radius: 10px; }
.auth__card h1 { font-weight: 500; font-size: 1.7rem; }

@media (max-width: 900px) {
  .topbar { margin: 10px 12px 0; }
  .content { padding: 20px 12px; }
  .box { padding: 22px 18px; }
  .box__head h2 { font-size: 1.45rem; }
  .hello h2, .game-head h2 { font-size: 1.4rem; }
}

/* Bandeau d'annonce et page de maintenance (réglés dans /admin/reglages) */
.announce { padding: 10px 16px; text-align: center; font-size: .92rem; font-weight: 500; background: rgba(242, 232, 213, .08); border-bottom: 1px solid rgba(242, 232, 213, .12); color: var(--cream); }
.announce--alerte { background: rgba(196, 38, 74, .22); border-color: rgba(196, 38, 74, .45); }
.content .announce { border: 1px solid rgba(242, 232, 213, .12); border-radius: 10px; margin-bottom: 18px; }
.content .announce--alerte { border-color: rgba(196, 38, 74, .45); }
.maintenance { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; text-align: center; }
.maintenance main { max-width: 520px; }
.maintenance__brand { font-family: "Montserrat", sans-serif; font-weight: 800; font-size: 1.6rem; margin: 0 0 18px; }
.maintenance__brand span { color: var(--red-light); }
.maintenance h1 { margin: 0 0 10px; }
.maintenance p { color: var(--muted); }
