:root {
  --blue: #1a73e8;
  --blue-dark: #1558b8;
  --green: #2e7d32;
  --amber: #f5a623;
  --red: #c62828;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --bg: #eef1f5;
  --card: #ffffff;
  --border: #e3e6ea;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; padding: 14px 28px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; font-size: 18px; color: var(--ink); }
.brand span { color: var(--blue); font-weight: 600; }
.topbar nav { display: flex; gap: 8px; align-items: center; }
.topbar nav a { padding: 8px 12px; border-radius: 7px; color: var(--ink); font-size: 14px; }
.topbar nav a:hover { background: #f1f4f9; text-decoration: none; }
.topbar nav a.active { color: var(--blue); font-weight: 600; }

.container { max-width: 920px; margin: 0 auto; padding: 28px 20px 60px; }

/* Buttons */
.btn {
  display: inline-block; background: var(--blue); color: #fff !important;
  padding: 9px 16px; border-radius: 8px; border: 0; cursor: pointer;
  font-size: 14px; font-weight: 600; text-decoration: none !important; font-family: inherit;
}
.btn:hover { background: var(--blue-dark); }
.btn.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn.ghost { background: transparent; color: var(--blue) !important; border: 1px solid var(--blue); }
.btn.ghost:hover { background: #eaf1fd; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.danger { background: #fff; color: var(--red) !important; border: 1px solid #f0c4c4; }
.btn.danger:hover { background: #fdecec; }

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Hero */
.hero { text-align: center; padding: 40px 0 28px; }
.hero-badge {
  display: inline-block; background: #eaf1fd; color: var(--blue);
  padding: 5px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; margin-bottom: 16px;
}
.hero h1 { font-size: 38px; line-height: 1.15; margin: 8px 0 14px; }
.lead { font-size: 17px; color: #444; max-width: 640px; margin: 0 auto 24px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Steps / grid */
.steps { margin-top: 36px; }
.steps h2, .safety h2, .section-title { font-size: 22px; margin: 28px 0 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.step { position: relative; }
.step-num {
  width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 10px;
}
.step h3 { margin: 0 0 6px; font-size: 16px; }
.step p { margin: 0; color: #555; font-size: 14px; }

.safety { margin-top: 40px; }
.checklist { list-style: none; padding: 0; }
.checklist li { padding: 6px 0 6px 28px; position: relative; }
.checklist li::before { content: "✓"; color: var(--green); font-weight: 800; position: absolute; left: 0; }
.muted { color: var(--muted); }

/* Page head */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.page-head h1 { font-size: 26px; margin: 6px 0; }
.head-actions { display: flex; gap: 10px; }
.back { font-size: 14px; }

/* Stats */
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 12px 0 8px; }
.stat { text-align: center; }
.stat-num { font-size: 32px; font-weight: 800; color: var(--blue); }
.stat-label { color: var(--muted); font-size: 13px; }

/* Fiche list */
.fiche-list { display: flex; flex-direction: column; gap: 12px; }
.fiche { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; }
.fiche-title { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fiche-meta { color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.fiche-actions { display: flex; gap: 8px; align-items: center; }
.fiche-actions form { margin: 0; }

.pill { font-size: 11px; padding: 2px 9px; border-radius: 11px; font-weight: 600; }
.pill-on { background: #e6f4ea; color: var(--green); }
.pill-off { background: #f1f1f1; color: #888; }
.pill-warn { background: #fff3da; color: #9a6b00; }

.empty { text-align: center; }

/* Forms */
.form { margin-top: 12px; }
.form .section-title { font-size: 16px; border-top: 1px solid var(--border); padding-top: 18px; margin-top: 22px; }
.form .section-title:first-of-type { border-top: 0; padding-top: 0; margin-top: 8px; }
.form-row { margin-bottom: 16px; display: flex; flex-direction: column; }
.form-row label { font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.req { color: var(--red); }
.form-row input[type=text], .form-row input[type=email], .form-row input[type=url],
.form-row input[type=number], .form-row input[type=password], .form-row textarea, .form-row select {
  width: 100%; padding: 10px 12px; border: 1px solid #cfd6df; border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px #1a73e826;
}
.form-row textarea { resize: vertical; }
.help { color: var(--muted); font-size: 12px; margin-top: 5px; }
.switch-label { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.switch-label input { width: 18px; height: 18px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; }

.login-box { max-width: 420px; margin: 40px auto; }
.login-box label { display: block; font-weight: 600; margin-bottom: 14px; }
.login-box input { width: 100%; padding: 10px 12px; border: 1px solid #cfd6df; border-radius: 8px; font-size: 14px; margin-top: 5px; }

/* Flash */
.flash { padding: 12px 16px; border-radius: 9px; margin-bottom: 18px; font-size: 14px; }
.flash-success { background: #e6f4ea; color: #1b5e20; border: 1px solid #b6e0c0; }
.flash-error { background: #fdecec; color: #b71c1c; border: 1px solid #f3c2c2; }
.flash-warn { background: #fff3da; color: #8a5d00; border: 1px solid #f0d9a8; }

/* Journal table */
.table-wrap { padding: 0; overflow-x: auto; }
table.journal { width: 100%; border-collapse: collapse; font-size: 13px; }
table.journal th, table.journal td { text-align: left; padding: 10px 14px; border-bottom: 1px solid #eef0f3; }
table.journal th { background: #f7f9fc; color: #555; font-weight: 600; }
.tag { background: #eef1f5; border-radius: 5px; padding: 2px 8px; font-size: 11px; color: #555; }

.codeblock { background: #1e1e2e; color: #d6e0ff; padding: 12px; border-radius: 8px; overflow-x: auto; font-size: 13px; }

.sitefoot { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 20px; }

@media (max-width: 560px) {
  .hero h1 { font-size: 28px; }
  .cols { grid-template-columns: 1fr; }
  .fiche { flex-direction: column; align-items: flex-start; }
}
