/* ==========================================================================
   docs.smmpanelperfect.com — documentation layer
   Sits on top of the admin panel's own stylesheets (admin-main.css,
   admin/style.css, admin/custom.css) so the docs inherit the exact fonts,
   colours, buttons and form controls the admin panel uses.
   ========================================================================== */

:root {
    --brand: #337ab7;
    --brand-dark: #286090;
    --brand-soft: #eef5fb;
    --ink: #2f3b4a;
    --ink-strong: #1f2a37;
    --muted: #7b8794;
    --line: #e4e9ef;
    --line-soft: #f0f3f7;
    --bg: #f6f8fb;
    --ok: #1e8e5a;
    --warn: #b7791f;
    --bad: #c0392b;
    --radius: 6px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, "Helvetica Neue", Arial, sans-serif;
    font-size: 14.5px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }

code, pre, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

code {
    font-size: .88em;
    background: #f2f5f9;
    border: 1px solid #e3e9f0;
    border-radius: 4px;
    padding: 1px 5px;
    color: #35506b;
    line-height: 1.4;
}

kbd {
    display: inline-block;
    font-size: .82em;
    font-weight: 600;
    line-height: 1;
    color: #3d4a58;
    background: #fff;
    border: 1px solid #d5dde5;
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 3px 6px;
    vertical-align: 1px;
}

/* ---------------------------------------------------------------- top bar */
.docs-topbar {
    position: fixed;
    inset: 0 0 auto 0;
    height: 56px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 20px;
    z-index: 60;
}

.docs-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: Poppins, Inter, sans-serif;
    font-weight: 500;
    font-size: 16px;
    color: var(--ink-strong);
    white-space: nowrap;
}
.docs-brand:hover { text-decoration: none; color: var(--ink-strong); }

.docs-brand__mark {
    width: 28px; height: 28px; border-radius: 7px;
    background: linear-gradient(135deg, var(--brand), #5aa0d8);
    color: #fff; display: grid; place-items: center;
    font-size: 14px; font-weight: 600;
}

.docs-brand__sub {
    font-size: 11px; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--muted);
    border-left: 1px solid var(--line); padding-left: 12px; margin-left: 2px;
}

.docs-topnav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.docs-topnav a {
    padding: 7px 12px; border-radius: var(--radius);
    font-size: 13.5px; font-weight: 500; color: #4a5765;
}
.docs-topnav a:hover { background: var(--line-soft); text-decoration: none; color: var(--ink-strong); }
.docs-topnav a.is-active { background: var(--brand-soft); color: var(--brand-dark); }

.docs-topbar .btn { margin-left: 8px; }

.docs-menu-btn {
    display: none; border: 1px solid var(--line); background: #fff;
    border-radius: var(--radius); width: 36px; height: 34px; cursor: pointer;
}
.docs-menu-btn span { display: block; width: 16px; height: 2px; background: #4a5765; margin: 3px auto; }

/* ------------------------------------------------------------------ shell */
.docs-shell {
    max-width: 1500px;
    margin: 0 auto;
    padding: 56px 20px 0;
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

/* ---------------------------------------------------------------- sidebar */
.docs-side {
    width: 268px;
    flex: 0 0 268px;
    position: sticky;
    top: 56px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 22px 6px 60px 0;
}
.docs-side::-webkit-scrollbar { width: 8px; }
.docs-side::-webkit-scrollbar-thumb { background: #d8dee6; border-radius: 4px; }

.docs-search { position: relative; margin-bottom: 16px; }
.docs-search input {
    width: 100%; height: 36px; padding: 0 12px 0 34px;
    border: 1px solid var(--line); border-radius: var(--radius);
    font-size: 13.5px; background: #fff; color: var(--ink);
}
.docs-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(51, 122, 183, .12); }
.docs-search i { position: absolute; left: 12px; top: 10px; color: var(--muted); font-size: 13px; }

.docs-side__group { margin-bottom: 18px; }
.docs-side__title {
    font-size: 11px; font-weight: 700; letter-spacing: .09em;
    text-transform: uppercase; color: var(--muted);
    padding: 0 10px 6px;
}
.docs-side a {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 10px; border-radius: var(--radius);
    color: #3c4855; font-size: 13.5px; line-height: 1.35;
}
.docs-side a:hover { background: #fff; color: var(--ink-strong); text-decoration: none; }
.docs-side a.is-active {
    background: #fff; color: var(--brand-dark); font-weight: 600;
    box-shadow: inset 3px 0 0 var(--brand);
}
.docs-side a .tag {
    margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; color: var(--ok); background: #e7f5ee;
    border-radius: 20px; padding: 2px 8px;
}
.docs-side a .tag.soon { color: var(--muted); background: var(--line-soft); }
.docs-side a.is-hidden { display: none; }

/* ------------------------------------------------------------------ main */
.docs-main {
    flex: 1 1 auto;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 34px 40px 64px;
    margin-bottom: 40px;
}

.docs-crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.docs-crumbs a { color: var(--muted); }
.docs-crumbs span { margin: 0 6px; }

.docs-main h1 {
    font-family: Poppins, Inter, sans-serif;
    font-size: 30px; font-weight: 500; color: var(--ink-strong);
    margin: 0 0 8px; line-height: 1.25;
}
.docs-lede { font-size: 15.5px; color: #55616e; margin: 0 0 22px; max-width: 76ch; }

.docs-main h2 {
    font-family: Poppins, Inter, sans-serif;
    font-size: 21px; font-weight: 500; color: var(--ink-strong);
    margin: 42px 0 12px; padding-top: 14px; border-top: 1px solid var(--line-soft);
}
.docs-main h2:first-of-type { border-top: 0; padding-top: 0; }
.docs-main h3 { font-size: 16.5px; font-weight: 600; color: var(--ink-strong); margin: 26px 0 8px; }
.docs-main h4 { font-size: 14.5px; font-weight: 600; color: var(--ink-strong); margin: 20px 0 6px; }
.docs-main p { margin: 0 0 14px; max-width: 82ch; }
.docs-main ul, .docs-main ol { margin: 0 0 16px; padding-left: 22px; max-width: 82ch; }
.docs-main li { margin-bottom: 6px; }
.docs-main li > ul, .docs-main li > ol { margin-top: 6px; }

.docs-anchor {
    color: #b9c3ce; font-size: 15px; margin-left: 8px; opacity: 0;
    transition: opacity .15s;
}
h2:hover .docs-anchor, h3:hover .docs-anchor { opacity: 1; }

/* ----------------------------------------------------------------- table */
.docs-table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 13.5px; }
.docs-table th {
    text-align: left; background: var(--line-soft); color: #46525f;
    font-weight: 600; padding: 9px 12px; border: 1px solid var(--line);
    white-space: nowrap;
}
.docs-table td { padding: 9px 12px; border: 1px solid var(--line); vertical-align: top; }
.docs-table tbody tr:nth-child(even) td { background: #fbfcfe; }
.docs-table code { font-size: 12.5px; background: var(--line-soft); border-color: #e3e9f0; white-space: nowrap; }
.docs-table td { line-height: 1.55; }
.docs-table th:first-child { width: 1%; }

/* ---------------------------------------------------------------- steps */
.docs-steps { list-style: none; padding: 0; margin: 0 0 20px; counter-reset: step; max-width: 82ch; }
.docs-steps > li {
    position: relative; padding: 0 0 0 46px; margin: 0 0 18px; counter-increment: step;
}
.docs-steps > li::before {
    content: counter(step);
    position: absolute; left: 0; top: 1px;
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--brand); color: #fff;
    display: grid; place-items: center;
    font-size: 14px; font-weight: 700;
    box-shadow: 0 0 0 4px rgba(51, 122, 183, .12);
}
.docs-steps > li strong { color: var(--ink-strong); }
.docs-steps > li p:last-child, .docs-steps > li ul:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------- callouts */
.docs-callout {
    display: flex; gap: 12px; align-items: flex-start;
    border: 1px solid var(--line); border-left: 4px solid var(--brand);
    background: #f8fbfe; border-radius: var(--radius);
    padding: 13px 16px; margin: 0 0 18px; max-width: 82ch; font-size: 13.8px;
}
.docs-callout i { margin-top: 2px; color: var(--brand); }
.docs-callout p:last-child { margin-bottom: 0; }
.docs-callout--warn { border-left-color: var(--warn); background: #fffaf1; }
.docs-callout--warn i { color: var(--warn); }
.docs-callout--tip { border-left-color: var(--ok); background: #f4fbf7; }
.docs-callout--tip i { color: var(--ok); }
.docs-callout--bad { border-left-color: var(--bad); background: #fdf5f4; }
.docs-callout--bad i { color: var(--bad); }

/* ------------------------------------------------------------ screenshot */
.docs-figure { margin: 0 0 22px; }
.docs-figure__frame {
    border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
    background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
    line-height: 0;
}
.docs-figure img { width: 100%; height: auto; display: block; }
.docs-figure figcaption {
    font-size: 12.8px; color: var(--muted); margin-top: 8px; line-height: 1.5;
}
.docs-figure figcaption b { color: #46525f; font-weight: 600; }
.docs-zoom {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; color: var(--brand); margin-top: 6px; cursor: pointer;
}

/* --------------------------------------------------------------- badges */
.docs-pill {
    display: inline-block; font-size: 11px; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase;
    padding: 2px 8px; border-radius: 20px; vertical-align: 1px;
}
.docs-pill--new { color: var(--ok); background: #e7f5ee; }
.docs-pill--soon { color: var(--muted); background: var(--line-soft); }

/* --------------------------------------------------------------- cards */
.docs-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin: 0 0 22px; }
.docs-card {
    border: 1px solid var(--line); border-radius: 8px; background: #fff;
    padding: 16px 18px; display: block; color: inherit;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.docs-card:hover { text-decoration: none; border-color: #c9d6e2; box-shadow: var(--shadow); transform: translateY(-1px); }
.docs-card h4 { margin: 0 0 4px; font-size: 15px; }
.docs-card p { margin: 0; font-size: 13px; color: var(--muted); }
.docs-card__icon { color: var(--brand); font-size: 16px; margin-bottom: 8px; display: block; }

/* ------------------------------------------------------------------ toc */
.docs-toc {
    width: 216px; flex: 0 0 216px;
    position: sticky; top: 78px;
    max-height: calc(100vh - 100px); overflow-y: auto;
    font-size: 13px; padding: 6px 0 40px;
}
.docs-toc__title {
    font-size: 11px; font-weight: 700; letter-spacing: .09em;
    text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.docs-toc a { display: block; color: #5b6875; padding: 4px 0 4px 12px; border-left: 2px solid var(--line); }
.docs-toc a:hover { color: var(--ink-strong); text-decoration: none; }
.docs-toc a.is-active { color: var(--brand-dark); border-left-color: var(--brand); font-weight: 600; }
.docs-toc a.lvl-3 { padding-left: 24px; font-size: 12.5px; color: #6c7885; }

/* The left "On this page" list duplicates the right-hand TOC on wide screens.
   Keep it only where the right TOC is hidden (<=1180px), so the page has one
   table of contents at a time. */
@media (min-width: 1181px) {
    .docs-side__group--toc { display: none; }
}

/* --------------------------------------------------------------- footer */
.docs-footer {
    border-top: 1px solid var(--line); background: #fff;
    padding: 22px 20px; text-align: center; color: var(--muted); font-size: 13px;
}
.docs-footer a { color: var(--muted); }

.docs-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.docs-pager a {
    flex: 1 1 0; border: 1px solid var(--line); border-radius: 8px;
    padding: 12px 16px; background: #fff;
}
.docs-pager a:hover { border-color: #c9d6e2; text-decoration: none; }
.docs-pager span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 3px; }
.docs-pager b { font-weight: 600; color: var(--ink-strong); font-size: 14px; }
.docs-pager .next { text-align: right; }

/* --------------------------------------------------------------- mobile */
@media (max-width: 1180px) {
    .docs-toc { display: none; }
}
@media (max-width: 900px) {
    .docs-shell { padding: 56px 12px 0; gap: 0; }
    .docs-menu-btn { display: block; }
    .docs-side {
        position: fixed; top: 56px; bottom: 0; left: 0;
        width: 280px; flex: none; background: #fff;
        border-right: 1px solid var(--line);
        padding: 18px 14px 60px; z-index: 50;
        transform: translateX(-102%); transition: transform .2s ease;
        max-height: none;
    }
    .docs-side.is-open { transform: none; box-shadow: 8px 0 24px rgba(16, 24, 40, .12); }
    .docs-main { padding: 22px 16px 48px; border-radius: 8px; }
    .docs-main h1 { font-size: 24px; }
    .docs-main h2 { font-size: 19px; }
    .docs-topnav a:not(.docs-topnav__keep) { display: none; }
}
@media (max-width: 560px) {
    .docs-brand__sub { display: none; }
    .docs-main { padding: 18px 12px 40px; }
    .docs-steps > li { padding-left: 38px; }
    .docs-steps > li::before { width: 26px; height: 26px; font-size: 13px; }
}

@media print {
    .docs-topbar, .docs-side, .docs-toc, .docs-footer, .docs-pager { display: none; }
    .docs-main { border: 0; box-shadow: none; }
}
