/* Wiki hướng dẫn sử dụng AuraCRM — CSS thuần, không build. */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-50: #eff6ff;
  --accent: #f59e0b;
  --note-bg: #fffbeb;
  --note-border: #fde68a;
  --radius: 12px;
  --sidebar-w: 280px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Bố cục ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; width: var(--sidebar-w); flex-shrink: 0;
  overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px 16px 32px;
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: auto; }
.brand b { font-size: 17px; }
.brand span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }

.toc-search {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font: inherit; font-size: 14px; margin-bottom: 12px; background: var(--bg);
}
.toc-search:focus { outline: 2px solid var(--primary-50); border-color: var(--primary); }

.toc ol { list-style: none; margin: 0; padding: 0; }
.toc > ol > li { margin-bottom: 6px; }
.toc a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--text-2); font-size: 14px; }
.toc a:hover { background: var(--bg); text-decoration: none; }
.toc > ol > li > a { font-weight: 600; color: var(--text); }
.toc ol ol a { padding-left: 22px; font-size: 13.5px; }
.toc a.active { background: var(--primary-50); color: var(--primary); }
.toc li.hidden { display: none; }

.content { flex: 1; min-width: 0; padding: 32px 48px 80px; }
.content > * { max-width: 980px; }

.menu-toggle { display: none; }

/* ---------- Nội dung ---------- */
header.hero { margin-bottom: 28px; }
header.hero h1 { font-size: 30px; line-height: 1.25; margin: 0 0 8px; }
header.hero p { color: var(--text-2); margin: 0; }

section.chapter { margin-top: 48px; }
section.chapter > h2 {
  font-size: 23px; margin: 0 0 6px; padding-bottom: 8px; border-bottom: 2px solid var(--border);
}
section.topic {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; margin-top: 18px;
}
section.topic > h3 { font-size: 18px; margin: 0 0 10px; }
h4 { font-size: 15px; margin: 16px 0 6px; }

.where {
  display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px;
  font-size: 13.5px; color: var(--text-2);
}
.where b { color: var(--text); font-weight: 600; }
.path { background: var(--primary-50); color: var(--primary); border-radius: 6px; padding: 2px 8px; font-weight: 600; }
.perm { background: #f1f5f9; color: var(--text-2); border-radius: 6px; padding: 2px 8px; }

ul, ol.steps { padding-left: 22px; margin: 8px 0; }
li { margin: 3px 0; }

.note {
  background: var(--note-bg); border: 1px solid var(--note-border); border-radius: 10px;
  padding: 10px 14px; margin: 12px 0; font-size: 14px;
}
.note b:first-child { color: #b45309; }

figure { margin: 14px 0 4px; }
figure img {
  width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgb(15 23 42 / 6%); cursor: zoom-in; background: #fff;
}
figure.small img { max-width: 520px; }
figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 10px 0; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #f8fafc; font-weight: 600; color: var(--text-2); font-size: 13px; }
.table-wrap { overflow-x: auto; }

kbd {
  font: 12px/1 ui-monospace, monospace; background: #f1f5f9; border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px;
}

footer { margin-top: 56px; color: var(--muted); font-size: 13px; }

/* ---------- Phóng ảnh ---------- */
dialog.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh;
}
dialog.lightbox::backdrop { background: rgb(15 23 42 / 75%); }
dialog.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 8px; display: block; cursor: zoom-out; }

/* ---------- Điện thoại ---------- */
@media (max-width: 900px) {
  html { scroll-padding-top: 64px; }
  .layout { display: block; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); z-index: 20;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 10px 30px rgb(0 0 0 / 15%);
  }
  body.toc-open .sidebar { transform: none; }
  body.toc-open::after {
    content: ""; position: fixed; inset: 0; background: rgb(15 23 42 / 35%); z-index: 10;
  }
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 6px; position: sticky; top: 8px; z-index: 5;
    margin: 8px 16px 0; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); font: inherit; font-size: 14px; font-weight: 600; color: var(--text);
    box-shadow: 0 2px 8px rgb(15 23 42 / 8%);
  }
  .content { padding: 16px 16px 64px; }
  header.hero h1 { font-size: 24px; }
  section.topic { padding: 16px; }
}
