/* Dokumentasi Snoba HRIS */
:root {
  --brand: #5b34b0;
  --brand-2: #7d52d2;
  --brand-ink: #3b1f7a;
  --brand-soft: #f3effc;
  --brand-line: #e3dbf6;
  --accent: #f97316;
  --bg: #ffffff;
  --bg-2: #f8f7fb;
  --panel: #ffffff;
  --text: #1c1830;
  --text-2: #4d4863;
  --muted: #7a7590;
  --line: #ebe8f2;
  --code-bg: #f4f2f9;
  --shadow: 0 1px 2px rgba(28, 24, 48, .05), 0 8px 28px -12px rgba(59, 31, 122, .18);
  --tip: #0f9f6e; --tip-bg: #ecfbf4; --tip-line: #bfeedb;
  --note: #2f6fdd; --note-bg: #eef4ff; --note-line: #cfe0ff;
  --warn: #c2410c; --warn-bg: #fff4ec; --warn-line: #fed7bd;
  --top-h: 60px;
  --side-w: 280px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #a789f0; --brand-2: #b9a0f5; --brand-ink: #d9cdfb; --brand-soft: #231c3a; --brand-line: #342a55;
    --bg: #110e1b; --bg-2: #161223; --panel: #1a1628; --text: #ece9f6; --text-2: #c3bdd6; --muted: #948eaa; --line: #2a2440;
    --code-bg: #221c35; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6);
    --tip: #4ade9f; --tip-bg: #0f2a20; --tip-line: #1c4d3a; --note: #7fb0ff; --note-bg: #111f38; --note-line: #213a66;
    --warn: #fb9a5b; --warn-bg: #2d1a0f; --warn-line: #5a3217; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #a789f0; --brand-2: #b9a0f5; --brand-ink: #d9cdfb; --brand-soft: #231c3a; --brand-line: #342a55;
  --bg: #110e1b; --bg-2: #161223; --panel: #1a1628; --text: #ece9f6; --text-2: #c3bdd6; --muted: #948eaa; --line: #2a2440;
  --code-bg: #221c35; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6);
  --tip: #4ade9f; --tip-bg: #0f2a20; --tip-line: #1c4d3a; --note: #7fb0ff; --note-bg: #111f38; --note-line: #213a66;
  --warn: #fb9a5b; --warn-bg: #2d1a0f; --warn-line: #5a3217; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.7 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
.ico { width: 18px; height: 18px; flex: none; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
kbd {
  font: 600 11px/1 Inter, system-ui, sans-serif; color: var(--muted); background: var(--bg-2);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 3px 6px;
}

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--top-h);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 17px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--brand); font-weight: 800; }
.brand em {
  font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand); background: var(--brand-soft); border: 1px solid var(--brand-line); padding: 2px 7px; border-radius: 999px;
}
.search-btn {
  display: flex; align-items: center; gap: 10px; margin-left: 24px; width: min(420px, 100%);
  height: 38px; padding: 0 10px 0 12px; border-radius: 10px; cursor: pointer;
  color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); font: inherit; font-size: 14px;
}
.search-btn:hover { border-color: var(--brand-line); color: var(--text-2); }
.search-btn span { flex: 1; text-align: left; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.app-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600;
  padding: 8px 12px; border-radius: 9px; color: var(--text-2);
}
.app-link .ico { width: 15px; height: 15px; }
.app-link:hover { background: var(--bg-2); text-decoration: none; color: var(--brand); }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px;
  border: 0; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-2); color: var(--brand); }
.menu-btn { display: none; margin-left: -8px; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

/* ---------------------------------------------------------------- layout */
.layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) 232px; max-width: 1480px; margin: 0 auto; }
.sidebar {
  position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto;
  padding: 20px 14px 40px; border-right: 1px solid var(--line); font-size: 14.5px;
  scrollbar-width: thin;
}
.side-home, .side-group summary {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px;
  color: var(--text); font-weight: 600; cursor: pointer; list-style: none; user-select: none;
}
.side-home { margin-bottom: 6px; }
.side-home .ico, .side-group summary .ico { color: var(--brand); width: 17px; height: 17px; }
.side-group summary::-webkit-details-marker { display: none; }
.side-group summary span { flex: 1; }
.side-group summary .chev { color: var(--muted); width: 15px; height: 15px; transition: transform .18s; }
.side-group[open] summary .chev { transform: rotate(90deg); }
.side-home:hover, .side-group summary:hover { background: var(--bg-2); text-decoration: none; }
.side-home.active { background: var(--brand-soft); color: var(--brand-ink); }
.side-group ul { list-style: none; margin: 2px 0 8px; padding: 0 0 0 27px; }
.side-group li a {
  display: block; padding: 6px 10px; margin-left: -1px; border-left: 1px solid var(--line);
  color: var(--text-2); line-height: 1.45;
}
.side-group li a:hover { color: var(--brand); text-decoration: none; border-left-color: var(--brand-line); }
.side-group li a.active { color: var(--brand); font-weight: 600; border-left: 2px solid var(--brand); background: linear-gradient(90deg, var(--brand-soft), transparent); border-radius: 0 8px 8px 0; }

.scrim { display: none; }
.content { min-width: 0; padding: 36px 48px 64px; }
.content article { max-width: 860px; }
.toc { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 36px 20px 40px 8px; font-size: 13.5px; }
.toc p { margin: 0 0 10px; font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; color: var(--muted); border-left: 2px solid transparent; line-height: 1.45; }
.toc li.l3 a { padding-left: 26px; font-size: 13px; }
.toc li a:hover { color: var(--text); text-decoration: none; }
.toc li a.on { color: var(--brand); border-left-color: var(--brand); font-weight: 600; }

/* ---------------------------------------------------------------- page head & prose */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.crumbs .sep { width: 14px; height: 14px; }
.crumbs span { color: var(--brand); font-weight: 600; }
.page-head h1 { margin: 0; font-size: clamp(28px, 3.4vw, 38px); line-height: 1.2; letter-spacing: -.02em; font-weight: 800; }
.lead { margin: 12px 0 0; font-size: 18px; color: var(--text-2); line-height: 1.6; }
.page-head { padding-bottom: 22px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }

.prose h2 { font-size: 23px; letter-spacing: -.01em; margin: 44px 0 12px; line-height: 1.3; font-weight: 750; position: relative; }
.prose h3 { font-size: 18px; margin: 30px 0 8px; line-height: 1.35; font-weight: 700; position: relative; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.anchor { position: absolute; left: -22px; color: var(--muted); opacity: 0; font-weight: 500; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; text-decoration: none; }
.prose p, .prose li { color: var(--text-2); }
.prose p { margin: 0 0 16px; }
.prose strong { color: var(--text); font-weight: 650; }
.prose code { font: 500 .88em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--code-bg); color: var(--brand-ink); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: #1b1630; color: #e9e5f7; padding: 16px 18px; border-radius: 12px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.prose pre code { background: none; color: inherit; padding: 0; }
.ui {
  display: inline-block; font-weight: 600; font-size: .92em; line-height: 1.35; color: var(--brand-ink);
  background: var(--brand-soft); border: 1px solid var(--brand-line); padding: 0 7px; border-radius: 6px;
}
.prose ul { padding-left: 22px; margin: 0 0 18px; }
.prose ul li { margin: 5px 0; }
.prose ul li::marker { color: var(--brand); }

ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 4px 0 22px; }
ol.steps > li { counter-increment: step; position: relative; padding: 2px 0 14px 46px; margin: 0; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--brand-2), var(--brand)); box-shadow: 0 4px 10px -4px var(--brand);
}
ol.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 14.5px; top: 34px; bottom: 4px; width: 1px; background: var(--brand-line); }

.table-wrap { overflow-x: auto; margin: 6px 0 22px; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-2); font-weight: 650; color: var(--text); white-space: nowrap; }
td { color: var(--text-2); }
tr:last-child td { border-bottom: 0; }

.callout { display: flex; gap: 12px; padding: 14px 16px; margin: 6px 0 22px; border-radius: 12px; border: 1px solid; }
.callout p { margin: 0 0 6px; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout-ico .ico { width: 20px; height: 20px; margin-top: 2px; }
.callout-title { font-weight: 700; color: var(--text) !important; }
.callout.tip { background: var(--tip-bg); border-color: var(--tip-line); } .callout.tip .callout-ico { color: var(--tip); }
.callout.note { background: var(--note-bg); border-color: var(--note-line); } .callout.note .callout-ico { color: var(--note); }
.callout.warn { background: var(--warn-bg); border-color: var(--warn-line); } .callout.warn .callout-ico { color: var(--warn); }

/* ---------------------------------------------------------------- screenshot */
.shot { margin: 10px 0 30px; }
.shot-frame {
  border-radius: 14px; overflow: hidden; background: var(--panel);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.shot-bar { display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 14px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.shot-url {
  flex: 1; max-width: 520px; margin: 0 auto; transform: translateX(-24px); text-align: center; font-size: 12px; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 2px 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shot-img { position: relative; display: block; cursor: zoom-in; line-height: 0; }
.shot-img img { width: 100%; height: auto; display: block; }
.zoom-hint {
  position: absolute; right: 12px; bottom: 12px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(28, 24, 48, .72); color: #fff; opacity: 0; transition: opacity .15s;
}
.shot-img:hover .zoom-hint, .shot-img:focus-visible .zoom-hint { opacity: 1; }
.shot figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); text-align: center; }
.shot.phone { max-width: 360px; margin-left: auto; margin-right: auto; }
.shot.phone .shot-frame { border-radius: 28px; border: 8px solid #1c1830; }
.phone-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; margin: 6px 0 26px; }
.phone-row .shot { margin: 0; }

.legend { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.legend li { display: flex; gap: 12px; align-items: flex-start; margin: 0; font-size: 15px; }
.legend .num {
  flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 700; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* ---------------------------------------------------------------- pager & footer */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 52px; }
.pager a {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); font-weight: 650;
}
.pager a:hover { border-color: var(--brand); text-decoration: none; box-shadow: var(--shadow); }
.pager small { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.pager small .ico { width: 14px; height: 14px; }
.pager .next { text-align: right; align-items: flex-end; }
.foot { max-width: 860px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- beranda */
.home article { max-width: 1080px; }
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 56px 48px 48px; margin-bottom: 44px;
  background: radial-gradient(1200px 400px at 90% -10%, rgba(249, 115, 22, .20), transparent 60%),
              radial-gradient(900px 500px at -10% 120%, rgba(125, 82, 210, .45), transparent 60%),
              linear-gradient(135deg, #2b1564 0%, #4a2598 55%, #6b44c0 100%);
  color: #fff;
}
.hero h1 { margin: 0 0 14px; font-size: clamp(32px, 4.6vw, 50px); line-height: 1.1; letter-spacing: -.03em; font-weight: 800; }
.hero p { margin: 0; max-width: 620px; font-size: 18px; line-height: 1.6; color: rgba(255, 255, 255, .86); }
.hero .eyebrow { display: inline-block; margin-bottom: 16px; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fed7aa; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 11px; font-weight: 650; font-size: 15px; }
.btn:hover { text-decoration: none; }
.btn .ico { width: 16px; height: 16px; }
.btn-light { background: #fff; color: #3b1f7a; }
.btn-light:hover { background: #f3effc; }
.btn-ghost { color: #fff; border: 1px solid rgba(255, 255, 255, .35); }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.hero-shot { margin: 36px -12px -120px auto; max-width: 780px; border-radius: 14px 14px 0 0; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .55); border: 1px solid rgba(255, 255, 255, .18); }
.hero-shot img { display: block; width: 100%; }

.section-title { font-size: 24px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 6px; }
.section-sub { margin: 0 0 22px; color: var(--text-2); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 48px; }
.card {
  display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover { text-decoration: none; border-color: var(--brand-line); box-shadow: var(--shadow); transform: translateY(-2px); }
.card .card-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); }
.card .card-ico .ico { width: 20px; height: 20px; }
.card h3 { margin: 4px 0 0; font-size: 16.5px; font-weight: 700; }
.card p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--text-2); }
.card .more { margin-top: auto; padding-top: 6px; font-size: 13.5px; font-weight: 650; color: var(--brand); }

.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; align-items: start; margin-bottom: 40px; }
.quick-panel { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); }
.quick-panel h3 { margin: 0 0 14px; font-size: 18px; }
.quick-panel ol.steps { margin-bottom: 0; }
.quick-panel ol.steps > li { padding-bottom: 12px; }
.quick-panel ol.steps a { font-weight: 600; }

/* ---------------------------------------------------------------- search */
.search-modal { position: fixed; inset: 0; z-index: 80; background: rgba(16, 12, 30, .45); backdrop-filter: blur(3px); display: flex; justify-content: center; padding: 10vh 16px 16px; }
.search-modal[hidden] { display: none; }
.search-box { width: min(640px, 100%); max-height: 72vh; display: flex; flex-direction: column; background: var(--panel); border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); overflow: hidden; }
.search-input { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-input input { flex: 1; height: 44px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 17px; }
#searchResults { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
#searchResults li a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--text); }
#searchResults li a:hover, #searchResults li a.sel { background: var(--brand-soft); text-decoration: none; }
#searchResults .r-sec { font-size: 12px; font-weight: 600; color: var(--brand); }
#searchResults .r-title { display: block; font-weight: 650; }
#searchResults .r-snip { display: block; font-size: 13.5px; color: var(--muted); line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#searchResults mark { background: color-mix(in srgb, var(--accent) 28%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
#searchResults .empty { padding: 26px; text-align: center; color: var(--muted); }
.search-foot { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }

.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(12, 9, 22, .88); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); background: #fff; }
.lightbox .icon-btn { position: absolute; top: 14px; right: 14px; color: #fff; background: rgba(255, 255, 255, .12); }

/* ---------------------------------------------------------------- responsif */
@media (max-width: 1240px) {
  .layout { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 920px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-grid; }
  .sidebar {
    position: fixed; z-index: 60; left: 0; top: 0; height: 100vh; width: min(310px, 86vw); background: var(--bg);
    transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .25); padding-top: 18px;
  }
  body.nav-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 55; background: rgba(16, 12, 30, .4); }
  body.nav-open .scrim { display: block; }
  .content { padding: 26px 16px 48px; }
  .search-btn { margin-left: auto; width: 38px; padding: 0; justify-content: center; }
  .search-btn span, .search-btn kbd { display: none; }
  .top-actions { margin-left: 0; }
  .app-link { display: none; }
  .brand em { display: none; }
  .topbar { gap: 8px; padding: 0 12px; }
  .hero { padding: 36px 22px 30px; border-radius: 18px; }
  .hero-shot { margin: 28px -8px -80px; }
  .anchor { display: none; }
  .pager { grid-template-columns: 1fr; }
  .shot-url { transform: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
