:root {
  --bg: #121214;
  --panel: #1b1b1f;
  --panel2: #232328;
  --line: #2e2e35;
  --text: #ececf0;
  --muted: #9a9aa6;
  --red: #E30613;
  --red-dark: #BA0606;
  --green: #2fb36d;
  --orange: #e0912f;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
a { color: #ff5a62; }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.25; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Logo TBPC : couleurs exactes, halo blanc sur fond sombre */
.logo { font-weight: 800; letter-spacing: .02em; font-size: 1.6rem; white-space: nowrap; }
.logo .tb { color: #000000; text-shadow: 0 0 1px #fff, 0 0 2px #fff, 0 0 4px rgba(255,255,255,.9), 0 0 8px rgba(255,255,255,.6); }
.logo .pc { color: #BA0606; text-shadow: 0 0 1px #fff, 0 0 2px #fff, 0 0 4px rgba(255,255,255,.9), 0 0 8px rgba(255,255,255,.6); }
.logo-sub { display: block; font-size: .75rem; color: var(--muted); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; margin-top: 2px; }

/* Page publique */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; width: 100%; max-width: 440px; }
.card .logo { font-size: 2.2rem; }
.card h1 { font-size: 1.35rem; margin-top: 18px; }

label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type=password], input[type=text], input[type=file] {
  width: 100%; padding: 11px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--text); font-size: 1rem;
}
input:focus { outline: 2px solid var(--red); outline-offset: 1px; }
button, .btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--red); color: #fff; padding: 11px 18px; font-size: .98rem; font-weight: 600; text-decoration: none;
}
button:hover, .btn:hover { background: #c70511; }
button.secondary, .btn.secondary { background: var(--panel2); border: 1px solid var(--line); color: var(--text); }
button.secondary:hover, .btn.secondary:hover { background: #2c2c33; }
button:disabled { opacity: .5; cursor: default; }
.full { width: 100%; justify-content: center; margin-top: 18px; }
.alert { border-radius: 8px; padding: 10px 12px; margin: 12px 0; font-size: .93rem; }
.alert.err { background: rgba(227,6,19,.12); border: 1px solid rgba(227,6,19,.45); color: #ffb3b7; }
.alert.ok { background: rgba(47,179,109,.12); border: 1px solid rgba(47,179,109,.45); color: #9be6bd; }
.steps-help { margin: 18px 0 0; padding-left: 20px; color: var(--muted); font-size: .9rem; }
.steps-help li { margin-bottom: 4px; }
.footer-note { margin-top: 20px; font-size: .82rem; color: var(--muted); text-align: center; }

/* Administration */
.admin { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; }
.side .logo { padding: 0 10px 18px; }
.side a.tab { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 600; }
.side a.tab:hover { background: var(--panel2); }
.side a.tab.on { background: rgba(227,6,19,.16); color: #fff; box-shadow: inset 3px 0 0 var(--red); }
.side form { margin-top: auto; }
.side .ver { color: var(--muted); font-size: .78rem; padding: 10px 12px 0; }
.main { padding: 28px 34px; max-width: 1100px; }
.main h1 { font-size: 1.5rem; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.kv { display: grid; grid-template-columns: 220px 1fr; gap: 8px 16px; }
.kv div:nth-child(odd) { color: var(--muted); }
.kv + p, .kv + .row, .kv + .alert { margin-top: 16px; }
#again { margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .8rem; font-weight: 600; }
.pill.on { background: rgba(47,179,109,.18); color: #7fe0aa; }
.pill.off { background: var(--panel2); color: var(--muted); }
.pill.live { background: rgba(227,6,19,.2); color: #ff8c92; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; }
td form { display: inline; }
td button { padding: 5px 10px; font-size: .82rem; }

/* Compilation */
.progress { height: 10px; background: var(--panel2); border-radius: 99px; overflow: hidden; margin: 14px 0; }
.progress > div { height: 100%; width: 0; background: var(--red); transition: width .4s; }
.steps { list-style: none; padding: 0; margin: 0 0 12px; }
.steps li { padding: 4px 0 4px 28px; position: relative; color: var(--muted); }
.steps li::before { content: ""; position: absolute; left: 4px; top: 10px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); }
.steps li.done { color: var(--text); }
.steps li.done::before { background: var(--green); border-color: var(--green); }
.steps li.current { color: #fff; font-weight: 600; }
.steps li.current::before { border-color: var(--red); border-top-color: transparent; animation: spin .8s linear infinite; }
.steps li.failed { color: #ff8c92; font-weight: 600; }
.steps li.failed::before { background: var(--red); border-color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }
pre.log { background: #0b0b0d; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; max-height: 260px; overflow: auto; font-size: .8rem; white-space: pre-wrap; color: #c9c9d1; margin: 0; }
.hidden { display: none !important; }

@media (max-width: 800px) {
  .admin { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .side form { margin-top: 0; }
  .main { padding: 20px; }
  .kv { grid-template-columns: 1fr; }
}
