/* 76K RMS — feuille de style unique, sobre, mobile d'abord */
:root {
  --bg: #f4f6f8; --fg: #1d2733; --muted: #6b7785; --card: #fff; --line: #dde3e9;
  --brand: #12395c; --accent: #1f6fb2; --ok: #1e8e3e; --off: #8a96a3; --warn: #d98200; --crit: #c62828;
  --radius: 8px; --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
code, pre { font-family: var(--mono); font-size: .9em; }
h1 { font-size: 1.45rem; margin: .4rem 0 1rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; }
h3 { font-size: .98rem; margin: 1.2rem 0 .5rem; }

header.top { background: var(--brand); color: #fff; display: flex; align-items: center; gap: 1rem; padding: .55rem 1rem; flex-wrap: wrap; }
header.top .brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.1rem; }
header.top nav { display: flex; gap: .2rem; align-items: center; flex-wrap: wrap; margin-left: auto; }
header.top nav a, header.top nav .link { color: #dbe7f3; text-decoration: none; padding: .35rem .6rem; border-radius: 6px; }
header.top nav a.active, header.top nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.burger { display: none; margin-left: auto; background: none; border: 0; color: #fff; font-size: 1.4rem; }

main { max-width: 1280px; margin: 0 auto; padding: 1rem; }
main.narrow { max-width: 460px; padding-top: 6vh; }
.brand-title { justify-content: center; color: var(--brand); font-size: 1.8rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.card.danger { border-color: #f1c4c4; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid2 > .card { margin-bottom: 0; }
.grid2 { margin-bottom: 1rem; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: var(--radius); padding: .8rem 1rem; text-decoration: none; color: var(--fg); display: flex; flex-direction: column; }
.tile .n { font-size: 1.8rem; font-weight: 700; }
.tile.ok { border-left-color: var(--ok); } .tile.off { border-left-color: var(--off); } .tile.warn { border-left-color: var(--warn); }

table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-size: .82rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
table.audit td code.small { white-space: pre-wrap; word-break: break-all; font-size: .78rem; }
.scroll { overflow-x: auto; }
td.actions { white-space: nowrap; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; word-break: break-word; }

.state, .sev, .badge { display: inline-block; padding: .08rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600; color: #fff; white-space: nowrap; }
.state.online { background: var(--ok); } .state.offline { background: var(--off); } .state.alert { background: var(--warn); }
.sev.info { background: var(--accent); } .sev.warning { background: var(--warn); } .sev.critical, .badge.crit { background: var(--crit); }

form.stack { display: flex; flex-direction: column; gap: .7rem; }
form .row, .row { display: flex; gap: .7rem; flex-wrap: wrap; align-items: flex-end; }
form .row label { flex: 1 1 120px; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; color: var(--muted); }
section.card > form > label { margin-bottom: .7rem; }
input, select, textarea { font: inherit; color: var(--fg); padding: .5rem .6rem; border: 1px solid #c4ccd5; border-radius: 6px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc3e6; border-color: var(--accent); }
button, .button { font: inherit; cursor: pointer; padding: .5rem .9rem; border-radius: 6px; border: 1px solid #b7c2cd; background: #eef2f6; color: var(--fg); text-decoration: none; display: inline-block; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { background: var(--crit); border-color: var(--crit); color: #fff; }
button.small { padding: .2rem .55rem; font-size: .85rem; }
button.link { background: none; border: 0; padding: .35rem .6rem; }
button:disabled { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }
.filters { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filters input, .filters select { width: auto; flex: 1 1 200px; }

.flash { padding: .6rem .8rem; border-radius: 6px; margin-bottom: 1rem; background: #e8f1fb; border: 1px solid #c3dbf2; }
.flash.error { background: #fdecec; border-color: #f2c2c2; color: #8e1c1c; }
.flash.ok { background: #e7f5ea; border-color: #bfe3c7; color: #1b5e2b; }
.flash.warn { background: #fff4e0; border-color: #f3d49b; color: #7a4b00; }
.muted { color: var(--muted); }
pre.script, pre.codes { background: #0f1b26; color: #d8e3ee; padding: .8rem; border-radius: 6px; overflow-x: auto; white-space: pre; font-size: .82rem; max-height: 60vh; }
pre.codes { white-space: pre-wrap; font-size: 1rem; line-height: 1.2; }
.copy { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.copy code { background: #eef2f6; padding: .35rem .5rem; border-radius: 4px; word-break: break-all; }
.secret { letter-spacing: .05em; }
.qr { display: flex; justify-content: center; margin: 1rem 0; }
.qr img, .qr svg { width: 220px; height: 220px; image-rendering: pixelated; }
.map { height: 65vh; min-height: 360px; border-radius: 6px; }
.legend { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; }
.dot.online { background: var(--ok); } .dot.offline { background: var(--off); } .dot.alert { background: var(--warn); }
.chart { margin: .5rem 0 1.2rem; }
.chart h4 { margin: 0 0 .3rem; font-size: .9rem; color: var(--muted); font-weight: 600; }
.pager { display: flex; justify-content: space-between; }

@media (max-width: 860px) {
  .grid2 { grid-template-columns: 1fr; }
  .burger { display: block; }
  header.top nav { display: none; width: 100%; flex-direction: column; align-items: stretch; }
  header.top nav.open { display: flex; }
  dl.kv { grid-template-columns: 1fr; }
  dl.kv dt { margin-top: .4rem; }
}
