/* ============================================================
   Rapida One MDM — Product Documentation
   Design system v2
   ============================================================ */

:root {
  --sidebar-bg: #04251e;
  --sidebar-border: rgba(255, 255, 255, 0.22);
  --sidebar-text: rgba(255, 255, 255, 0.85);
  --sidebar-text-active: #ffffff;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --accent-text: #4338ca;
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --green: #059669;  --green-soft: #ecfdf5;
  --amber: #d97706;  --amber-soft: #fffbeb;
  --red: #dc2626;    --red-soft: #fef2f2;
  --blue: #2563eb;   --blue-soft: #eff6ff;
  --purple: #7c3aed; --purple-soft: #f5f3ff;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding: 28px 20px 40px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 20px;
}

.logo {
  width: 40px; height: 40px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.sidebar-brand .name { color: #ffffff; font-weight: 600; font-size: 15px; }
.sidebar-brand .sub  { color: rgba(255, 255, 255, 0.7); font-size: 12px; }

.nav-section { margin-bottom: 22px; }

.nav-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  padding: 0 10px 8px;
}

.nav-link {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover { background: rgba(255, 255, 255, 0.14); color: #ffffff; }

.nav-link.active {
  background: rgba(255, 255, 255, 0.18);
  color: var(--sidebar-text-active);
  font-weight: 600;
}

/* ---------- Main column ---------- */
.main {
  flex: 1;
  min-width: 0;
  max-width: 900px;
  padding: 40px 56px 80px;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-text); }
.breadcrumb .sep { margin: 0 8px; color: var(--border); }

.hero { margin-bottom: 36px; }

.hero h1 {
  font-size: 34px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 12px;
}

.hero .lede {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- Typography ---------- */
h2 {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 44px 0 14px;
  padding-top: 8px;
}

h3 {
  font-size: 17px;
  font-weight: 650;
  margin: 28px 0 10px;
}

p { margin-bottom: 14px; }

ul, ol { margin: 0 0 16px 24px; }
li { margin-bottom: 6px; }

a { color: var(--accent-text); }

strong { font-weight: 650; }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
}

pre {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 18px 22px;
  overflow-x: auto;
  margin: 16px 0 20px;
  font-size: 13.5px;
  line-height: 1.6;
}
pre code { background: none; border: none; color: inherit; padding: 0; font-size: inherit; }

/* ---------- Tables ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14.5px;
}

th {
  text-align: left;
  font-weight: 650;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }

/* ---------- Callouts ---------- */
.callout {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 15px;
  border: 1px solid;
}

.callout .callout-title {
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.callout.tip     { background: var(--green-soft);  border-color: #a7f3d0; }
.callout.tip     .callout-title { color: var(--green); }
.callout.note    { background: var(--blue-soft);   border-color: #bfdbfe; }
.callout.note    .callout-title { color: var(--blue); }
.callout.warning { background: var(--amber-soft);  border-color: #fde68a; }
.callout.warning .callout-title { color: var(--amber); }
.callout.danger  { background: var(--red-soft);    border-color: #fecaca; }
.callout.danger  .callout-title { color: var(--red); }

/* ---------- Pills & badges ---------- */
.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 650;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.pill.golden  { background: var(--green-soft);  color: var(--green); }
.pill.pending { background: var(--amber-soft);  color: var(--amber); }
.pill.draft   { background: var(--red-soft);    color: var(--red); }
.pill.model   { background: var(--purple-soft); color: var(--purple); }
.pill.info    { background: var(--blue-soft);   color: var(--blue); }
.pill.neutral { background: var(--bg-subtle);   color: var(--text-muted); border: 1px solid var(--border); }

kbd {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 8px;
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px 0 28px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--bg);
}

.card .card-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}

.card h4 { font-size: 15px; font-weight: 650; margin-bottom: 6px; }
.card p  { font-size: 14px; color: var(--text-muted); margin: 0; }

/* ---------- Hierarchy / step list ---------- */
.step-list { counter-reset: step; list-style: none; margin: 24px 0; padding: 0; }

.step-list > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 26px 52px;
  margin: 0;
}

.step-list > li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}

.step-list > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 15px; top: 38px; bottom: 6px;
  width: 2px;
  background: var(--border);
}

.step-list h4 { font-size: 16px; font-weight: 650; margin-bottom: 6px; padding-top: 4px; }
.step-list p  { font-size: 15px; }

/* ---------- FAQ accordions ---------- */
.faq { margin: 20px 0 8px; }

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  background: var(--bg);
  overflow: hidden;
}

.faq summary {
  cursor: pointer;
  padding: 15px 20px;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  position: relative;
  padding-right: 48px;
  transition: background 0.15s;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  position: absolute;
  right: 20px; top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: 400;
  color: var(--text-muted);
}

.faq details[open] summary::after { content: "–"; }
.faq details[open] summary { background: var(--bg-subtle); }
.faq summary:hover { background: var(--bg-subtle); }

.faq .faq-body {
  padding: 14px 20px 18px;
  font-size: 15px;
  color: var(--text);
  border-top: 1px solid var(--border);
}
.faq .faq-body p:last-child { margin-bottom: 0; }

/* ---------- Prev / next footer ---------- */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.pager a {
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  flex: 1;
  max-width: 48%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pager a:hover { border-color: var(--accent); box-shadow: 0 1px 6px rgba(79,70,229,0.12); }

.pager .dir { font-size: 12px; color: var(--text-muted); display: block; }
.pager .title { font-weight: 650; color: var(--text); font-size: 15px; }
.pager a.next { text-align: right; margin-left: auto; }

.footer-note {
  margin-top: 40px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .main { padding: 28px 22px 60px; }
  .pager { flex-direction: column; }
  .pager a { max-width: 100%; }
}
