:root {
  --navy: #1b2e4b;
  --sky: #7ec8e3;
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #111111;
  --muted: #6b7280;
  --border: #e3e6eb;
  --danger: #e0483e;
  --ok: #1f9d55;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  min-height: 100%;
}
a { color: var(--navy); }
.wrap { max-width: 960px; margin: 0 auto; padding: 28px 20px 60px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 44px; width: auto; display: block; }
.brand span { font-weight: 500; letter-spacing: 0.03em; }
.topbar-main { display: flex; align-items: center; gap: 12px; }
.nav { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; font-size: 0.85rem; }
/* Bouton burger : masqué par défaut (desktop), affiché sous 640px. */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 42px; height: 38px; padding: 0; cursor: pointer;
  background: #fff; border: 1px solid var(--border); border-radius: 9px;
}
.nav-toggle span { display: block; width: 20px; height: 2px; margin: 0 auto; background: var(--navy); border-radius: 2px; }
.nav a { text-decoration: none; }
.nav a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 6px; }
h2 { font-size: 1.1rem; margin: 28px 0 12px; }
.sub { color: var(--muted); font-size: 0.85rem; margin: 0 0 22px; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px; margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(27,46,75,0.05);
}
.card.center { max-width: 400px; margin: 8vh auto 0; }

label { display: block; font-size: 0.8rem; color: var(--muted); margin: 12px 0 5px; }
input[type=text], input[type=password], input[type=date], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 9px; font-family: inherit; font-size: 0.9rem; background: #fff;
}
textarea { min-height: 340px; font-size: 0.8rem; line-height: 1.4; white-space: pre; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 6px; }
.checks label { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ink); font-size: 0.85rem; }
.checks input { width: auto; }

button, .btn {
  display: inline-block; border: 0; border-radius: 9px; cursor: pointer;
  background: var(--navy); color: #fff; padding: 10px 16px; font-family: inherit;
  font-size: 0.85rem; text-decoration: none;
}
button:hover, .btn:hover { opacity: 0.92; }
.btn.small { padding: 6px 10px; font-size: 0.78rem; }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid var(--border); }
.btn.danger { background: var(--danger); }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; }
.tag.ok { background: rgba(31,157,85,0.12); color: var(--ok); }
.tag.off { background: rgba(107,114,128,0.15); color: var(--muted); }
.tag.live { background: rgba(224,72,62,0.12); color: var(--danger); }

.flash { padding: 11px 14px; border-radius: 9px; font-size: 0.85rem; margin-bottom: 18px; }
.flash.err { background: rgba(224,72,62,0.1); color: var(--danger); }
.flash.ok { background: rgba(31,157,85,0.1); color: var(--ok); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stream-card { display: block; text-decoration: none; color: inherit; }
.stream-card h3 { margin: 0 0 6px; font-size: 1rem; }
.muted { color: var(--muted); font-size: 0.8rem; }
.hint { color: var(--muted); font-size: 0.75rem; margin-top: 4px; }
code { background: #eef0f3; padding: 1px 5px; border-radius: 5px; font-size: 0.82em; }

/* --- Responsive (mobile / petits écrans) --- */
@media (max-width: 640px) {
  .wrap { padding: 20px 14px 48px; }

  /* Menu burger : logo + bouton sur la 1re ligne, menu déroulant en dessous. */
  .topbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .topbar-main { justify-content: space-between; }
  .nav-toggle { display: flex; }
  .nav {
    display: none; flex-direction: column; align-items: flex-start; gap: 14px;
    padding-top: 12px; border-top: 1px solid var(--border);
  }
  .topbar.open .nav { display: flex; }

  /* Les formulaires à deux colonnes s'empilent. */
  .form-grid { grid-template-columns: 1fr; }

  /* Tables clé/valeur : on évite le débordement horizontal. */
  th, td { padding: 8px 6px; }
  table th { width: auto !important; }
  td code, th code { word-break: break-all; }
}
