:root {
  /* Charte IT Vision Consult */
  --bg: #17151f;
  --panel: #221f2e;
  --panel-2: #2b2738;
  --border: #3a3649;
  --text: #f4f2f8;
  --muted: #9a95ab;
  --accent: #e50279;
  --accent-2: #d82022;
  --link: #ff4f9e;
  --grad: linear-gradient(90deg, var(--accent), var(--accent-2));
  --ok: #3fb68b;
  --warn: #e8a33d;
  --err: #ff5a5f;
  --radius: 14px;
  --sans: 'IBM Plex Sans', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --title: 'Poppins', var(--sans);
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14.5px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-family: var(--title); font-size: 26px; margin: 4px 0; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
h3 { font-family: var(--title); font-size: 15px; margin: 0; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono, code, pre { font-family: var(--mono); font-size: 13px; }
.ok { color: var(--ok); } .err { color: var(--err); }
.right { text-align: right; } .nowrap { white-space: nowrap; }
.inline { display: inline; }

/* Barre du haut */
.topbar { background: rgba(23,21,31,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.brand:hover { text-decoration: none; }
.logo-chip { background: #fff; border-radius: 9px; padding: 6px 12px; display: flex; align-items: center; }
.logo-chip img { height: 26px; width: auto; display: block; }
.brand-name { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.topnav { display: flex; align-items: center; gap: 16px; }
.topnav a { color: var(--muted); }
.topnav a.active, .topnav a:hover { color: var(--text); text-decoration: none; }
.linklike { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
.linklike:hover { color: var(--text); }

.container { max-width: 1200px; width: 100%; margin: 0 auto; padding: 20px 16px 40px; flex: 1; }
.footer { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; max-width: 1200px; width: 100%; margin: 0 auto; color: var(--muted); font-size: 12.5px; padding: 18px 16px; border-top: 1px solid var(--border); }
.eyebrow { display: inline-block; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.print-brand { display: none; }

/* Blocs */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card.narrow { max-width: 480px; margin: 40px auto; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
details.card summary { cursor: pointer; font-weight: 600; }
details.card[open] summary { margin-bottom: 12px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { color: var(--muted); font-size: 13px; }
.toolbar { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 12px; align-items: center; }
.toolbar .filter { max-width: 280px; margin: 0 auto 0 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.grid .card { margin: 0; }
.empty { padding: 12px 0; text-align: center; }

.tag { display: inline-block; font-family: var(--mono); font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); }
.tag-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }

/* Flash */
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; }
.flash-ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.flash-error { border-color: color-mix(in srgb, var(--err) 45%, transparent); background: color-mix(in srgb, var(--err) 10%, transparent); }
code.pw { background: var(--panel-2); padding: 2px 8px; border-radius: 4px; font-size: 14px; user-select: all; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--grad); color: #fff;
  padding: 8px 16px; border-radius: 9px; font-family: var(--mono); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, opacity .15s ease;
}
.btn:hover { opacity: .92; transform: translateY(-1px); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--panel-2); border-color: var(--accent); }
.btn-danger-ghost { background: transparent; color: var(--err); border: 1px solid var(--border); }
.btn-danger-ghost:hover { background: color-mix(in srgb, var(--err) 12%, transparent); }
.btn-sm { padding: 3px 9px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* Formulaires */
input, select, textarea {
  width: 100%; background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px 12px; font: inherit; margin-top: 4px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; line-height: 1.5; }
input[type=file] { padding: 6px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.form .row, form.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form .row > label, form.row > label { flex: 1 1 180px; }
.form .row > label.grow { flex: 3 1 260px; }
.form .row > label.narrow-field { flex: 0 1 100px; }
form.row .btn, .form .row .btn { margin-bottom: 12px; }
.card form.row { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.search input { min-width: 280px; margin: 0; }
.filter { margin: 0 0 12px; }

/* Login */
.login-wrap { position: relative; display: flex; justify-content: center; padding-top: 7vh; }
.login { position: relative; width: 100%; max-width: 420px; padding: 32px; }
.login h1 { font-size: 24px; }
.login .btn-block { margin-top: 4px; padding: 11px; }
.login-art { position: absolute; width: 360px; top: 2vh; left: 50%; margin-left: 120px; opacity: .06; pointer-events: none; }
@media (max-width: 900px) { .login-art { display: none; } }

/* Onglets */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-image: var(--grad) 1; border-bottom-width: 2px; border-bottom-style: solid; }
.tabs a span { font-size: 11px; background: var(--panel-2); border-radius: 999px; padding: 0 6px; margin-left: 4px; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--panel-2); }
.table .num { text-align: right; width: 70px; }
tr.inactive { opacity: .5; }

/* Listes */
.links, .results, .files { list-style: none; margin: 0; padding: 0; }
.links li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.links li:last-child { border-bottom: 0; }
.results li { padding: 6px 0; }
.files li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.files li:last-child { border-bottom: 0; }
.file-icon { width: 40px; flex: none; text-align: center; font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--accent); background: var(--panel-2); border-radius: 4px; padding: 6px 0; }
.file-name { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.upload { display: flex; gap: 8px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.upload input { margin: 0; }

/* Fiche équipement */
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 24px; margin: 0 0 12px; }
.specs dt { color: var(--muted); font-size: 12px; }
.specs dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.notes { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }

/* Contenu Markdown */
.prose { font-size: 15px; line-height: 1.65; overflow-wrap: break-word; }
.prose h1 { font-size: 22px; margin: 20px 0 8px; } .prose h2 { font-family: var(--title); font-weight: 700; font-size: 18px; margin: 20px 0 8px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.prose h3 { font-size: 15px; margin: 16px 0 6px; }
.prose strong { color: #fff; }
.prose > :first-child { margin-top: 0; }
.prose img { max-width: 100%; border-radius: 6px; border: 1px solid var(--border); }
.prose table { border-collapse: collapse; width: 100%; margin: 12px 0; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.prose th { background: var(--panel-2); }
.prose code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
.prose pre { background: var(--panel-2); padding: 12px; border-radius: 6px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { margin: 12px 0; padding: 4px 14px; border-left: 3px solid var(--accent); color: var(--muted); }

@media (max-width: 640px) {
  .search, .search input { width: 100%; min-width: 0; }
  .brand-name { display: none; }
  .footer { justify-content: center; text-align: center; }
  .page-head { align-items: flex-start; }
}

@media print {
  :root { --bg: #fff; --panel: #fff; --panel-2: #f3f3f3; --border: #ccc; --text: #000; --muted: #555; }
  .topbar, .footer, .no-print, .upload, .tabs, .search, .crumb, form.inline, .btn, .login-art { display: none !important; }
  body { background: #fff; color: #000; }
  .print-brand { display: flex; align-items: center; gap: 16px; padding: 0 0 12px; margin-bottom: 16px; border-bottom: 3px solid #e50279; }
  .print-brand img { height: 34px; }
  .print-brand span { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #555; }
  .card { border: 0; padding: 0; background: none; }
  .eyebrow { color: #e50279; }
  .prose strong { color: #000; }
  .empty { display: none; }
  .print-brand { padding: 0 16px 12px; }
  a { color: #000; }
}
