@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --border: #eaecf0;
  --border2: #d1d5db;
  --text: #0f172a;
  --text2: #475569;
  --text3: #94a3b8;

  /* ── Accent principal : #963dec ── */
  --accent: #963dec;
  --accent-light: #a855f7;
  --accent-d: #7c2fd1;
  --accent-bg: #f8f0ff;
  --accent-border: #e5c8ff;

  --green: #059669;
  --green-bg: #ecfdf5;
  --blue: #2563eb;
  --blue-bg: #eff6ff;
  --yellow: #d97706;
  --yellow-bg: #fffbeb;
  --red: #dc2626;
  --red-bg: #fef2f2;

  --sidebar-w: 268px;
  --radius: 10px;
  --radius-lg: 14px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ─── SIDEBAR ──────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.sidebar-brand-logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.sidebar-brand-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.sidebar-brand-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  margin-top: 1px;
  letter-spacing: 0.02em;
}

.sidebar-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 18px 20px 6px;
}

.sidebar-nav { flex: 1; padding: 8px 10px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8.5px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
  margin-bottom: 1px;
}
.nav-link:hover { background: var(--bg); color: var(--text); }
.nav-link.active { background: var(--accent-bg); color: var(--accent); }
.nav-link svg { flex-shrink: 0; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  font-size: 11.5px;
  color: var(--text3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* ─── MAIN ─────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }

/* ─── TOPBAR ───────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0;
  height: 54px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  gap: 16px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text3);
}
.breadcrumb a { text-decoration: none; transition: color 0.1s; }
.breadcrumb a:hover { color: var(--text2); }
.breadcrumb-sep { font-size: 11px; }
.breadcrumb strong { color: var(--text); font-weight: 700; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border2);
  color: var(--text2);
  transition: all 0.12s;
  background: white;
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary {
  background: var(--accent);
  color: white !important;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-d); color: white; border-color: var(--accent-d); }

/* ─── CONTENT ──────────────────────────────────────────── */
.content-wrap {
  flex: 1;
  max-width: 860px;
  width: 100%;
  padding: 44px 44px 96px;
}

/* ─── HERO ─────────────────────────────────────────────── */
.page-hero {
  margin-bottom: 44px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  padding: 3px 10px;
  border-radius: 99px;
  margin-bottom: 14px;
  letter-spacing: 0.03em;
}
.page-hero h1 {
  font-size: 34px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 12px;
}
.page-hero p {
  font-size: 15.5px;
  color: var(--text2);
  line-height: 1.7;
  max-width: 580px;
  margin: 0;
}

/* ─── TYPOGRAPHY ───────────────────────────────────────── */
h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 40px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 10px;
}
p { color: var(--text2); margin-bottom: 14px; line-height: 1.75; }
p:last-child { margin-bottom: 0; }

hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* ─── CARDS ────────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.card-grid-3 { grid-template-columns: repeat(3, 1fr); }

.doc-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-decoration: none;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
  cursor: pointer;
}
.doc-card:hover {
  border-color: var(--accent-border);
  box-shadow: 0 4px 20px rgba(150,61,236,0.08);
  transform: translateY(-1px);
}
.doc-card-icon { font-size: 24px; margin-bottom: 10px; line-height: 1; }
.doc-card-title { font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.doc-card-desc { font-size: 12px; color: var(--text2); line-height: 1.55; }

/* ─── CODE ─────────────────────────────────────────────── */
.code-block { margin: 16px 0; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid #1e293b; }
.code-header {
  background: #1e293b;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #64748b;
}
.code-dots { display: flex; gap: 5px; }
.code-dot { width: 10px; height: 10px; border-radius: 50%; }
.code-dot:nth-child(1) { background: #ef4444; }
.code-dot:nth-child(2) { background: #f59e0b; }
.code-dot:nth-child(3) { background: #22c55e; }
pre {
  background: #0f172a;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 0;
}
pre code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.75;
  background: none;
  padding: 0;
  border-radius: 0;
  color: #e2e8f0;
}
code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: var(--accent-bg);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 5px;
}

.tok-key   { color: #93c5fd; }
.tok-str   { color: #86efac; }
.tok-num   { color: #fda4af; }
.tok-com   { color: #475569; font-style: italic; }
.tok-cmd   { color: #c4b5fd; font-weight: 500; }

/* ─── ALERTS ───────────────────────────────────────────── */
.alert {
  display: flex;
  gap: 13px;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin: 18px 0;
  font-size: 13px;
  line-height: 1.65;
}
.alert-ico { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.alert strong { display: block; font-weight: 700; margin-bottom: 2px; color: inherit; }
.alert p { margin: 0; color: inherit; }

.alert-info    { background: var(--blue-bg);    border-left: 3px solid var(--blue);   color: #1d4ed8; }
.alert-warn    { background: var(--yellow-bg);  border-left: 3px solid var(--yellow); color: #92400e; }
.alert-success { background: var(--green-bg);   border-left: 3px solid var(--green);  color: #065f46; }
.alert-danger  { background: var(--red-bg);     border-left: 3px solid var(--red);    color: #991b1b; }
.alert-purple  { background: var(--accent-bg);  border-left: 3px solid var(--accent); color: var(--accent-d); }

/* ─── STEPS ────────────────────────────────────────────── */
.steps { margin: 22px 0; }
.step {
  display: flex;
  gap: 18px;
  margin-bottom: 28px;
  position: relative;
}
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px; top: 38px; bottom: -18px;
  width: 2px;
  background: var(--border);
}
.step-n {
  width: 32px; height: 32px;
  background: var(--accent-bg);
  border: 2px solid var(--accent-border);
  color: var(--accent);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-body { flex: 1; padding-top: 4px; }
.step-title { font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.step-desc { font-size: 13px; color: var(--text2); line-height: 1.65; }

/* ─── TABLE ────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 16px 0;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  padding: 10px 16px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbfc; }

/* ─── BADGES ───────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue); }
.badge-purple { background: var(--accent-bg); color: var(--accent); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-gray   { background: #f1f5f9;          color: #64748b; }

/* ─── CHECK LIST ───────────────────────────────────────── */
.check-list { list-style: none; margin: 12px 0; }
.check-list li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 5px 0;
  font-size: 13px; color: var(--text2);
}
.check-list li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  margin-top: 2px;
  flex-shrink: 0;
}

/* ─── SVG ICON HELPERS ─────────────────────────────────── */
.ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}
h2 svg, h3 svg { vertical-align: middle; }
.doc-card-icon svg { display: block; }
