/* ═══════════════════════════════════════════════════════════
   style.css — Styles communs GEN·QCM / Dashboard
   ═══════════════════════════════════════════════════════════ */

/* ── Variables communes ────────────────────────────────── */
:root {
  --bg: #0a0c0f;
  --surface: #111418;
  --surface2: #1a1f26;
  --border: #2a3040;
  --accent: #c8a84b;
  --accent2: #4b7fc8;
  --success: #4bc87a;
  --danger: #c84b4b;
  --text: #d4dbe8;
  --text-dim: #6b7a8d;
  --text-bright: #eef2f8;
  --mono: 'Share Tech Mono', monospace;
  --display: 'Bebas Neue', sans-serif;
  --body: 'Barlow', sans-serif;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Grille de fond ────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(200,168,75,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200,168,75,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Container ─────────────────────────────────────────── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 60px;
  position: relative;
  z-index: 1;
}
.container.wide {
  max-width: 1400px;
}

/* ── Header commun ─────────────────────────────────────── */
header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
  display: flex;
  align-items: flex-end;
  gap: 20px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}

.logo {
  font-family: var(--display);
  font-size: 44px;
  letter-spacing: 4px;
  color: var(--accent);
  line-height: 1;
}
.logo span { color: var(--text-dim); font-size: 28px; }

.header-meta { flex: 1; padding-bottom: 4px; }
.header-meta p {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ── Navigation entre pages ────────────────────────────── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-link {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 2px;
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(200,168,75,0.06);
}
.nav-link.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(200,168,75,0.08);
}

/* ── Status dot ────────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  margin-right: 6px;
  vertical-align: middle;
}
.status-dot.active { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.error  { background: var(--danger);  box-shadow: 0 0 6px var(--danger); }

/* ── Sections ──────────────────────────────────────────── */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-bottom: 16px;
  overflow: hidden;
}
.section-header {
  padding: 12px 20px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
}
.section-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  margin-left: auto;
}
.section-body { padding: 20px; }

/* ── Inputs ────────────────────────────────────────────── */
input[type="text"], input[type="number"], select, textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
select option { background: var(--surface2); }

/* ── Boutons ────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #0a0c0f;
  border: none;
  border-radius: 2px;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 4px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}
.btn-primary:hover { background: #d9b85c; }
.btn-primary:disabled { background: var(--border); color: var(--text-dim); cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}
.btn-secondary:hover { background: rgba(200,168,75,0.1); }
.btn-secondary:disabled { border-color: var(--border); color: var(--text-dim); cursor: not-allowed; }

.btn-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}
.btn-danger:hover { background: rgba(200,75,75,0.1); }

/* ── Separator ─────────────────────────────────────────── */
.separator { height: 1px; background: var(--border); margin: 16px 0; }

/* ── Field group ───────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── Error box ─────────────────────────────────────────── */
.error-box {
  background: rgba(200,75,75,0.08);
  border: 1px solid var(--danger);
  border-radius: 2px;
  padding: 14px 18px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--danger);
  margin-top: 12px;
  display: none;
}

/* ── Spinner ───────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid rgba(200,168,75,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ────────────────────────────────────────────── */
footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}
