/*==========================================================
Documentation
==========================================================*/

.docs-layout {
    display: flex;
    align-items: flex-start;
    gap: 50px;
    padding: 70px 0 100px;
}

.docs-toc {
    flex: 0 0 250px;
    position: sticky;
    top: 100px;
}

.docs-toc h6 {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #8a93a6;
    margin-bottom: 18px;
}

.docs-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid #e9edf5;
}

.docs-toc li {
    margin: 0;
}

.docs-toc a {
    display: block;
    padding: 9px 0 9px 18px;
    margin-left: -2px;
    border-left: 2px solid transparent;
    color: #5f6777;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    transition: .2s;
}

.docs-toc a:hover,
.docs-toc a.active {
    color: var(--primary);
    border-left-color: var(--primary);
}

.docs-content {
    flex: 1 1 auto;
    min-width: 0;
}

.docs-intro {
    background: #f8fbff;
    border: 1px solid #e9edf5;
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 50px;
}

.docs-intro p:last-child {
    margin-bottom: 0;
}

.docs-module {
    padding: 44px 0;
    border-bottom: 1px solid #e9edf5;
}

.docs-module:last-child {
    border-bottom: none;
}

.docs-module-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eef5ff;
    color: var(--primary);
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 14px;
}

.docs-module h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 12px;
}

.docs-module > p.docs-desc {
    color: #5f6777;
    font-size: 15.5px;
    max-width: 780px;
    margin-bottom: 24px;
}

.docs-flowchart {
    background: #fff;
    border: 1px solid #e9edf5;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.docs-flowchart img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

.docs-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.docs-fields li {
    display: flex;
    gap: 10px;
    font-size: 14.5px;
    color: #333;
    align-items: flex-start;
}

.docs-fields li i {
    color: var(--primary);
    margin-top: 3px;
}

/* Nested sidebar tree */
.docs-toc {
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.docs-toc-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 9px 0 9px 18px;
    margin-left: -2px;
    border-left: 2px solid transparent;
    color: var(--dark);
    font-size: 14.5px;
    font-weight: 700;
    text-align: left;
}

.docs-toc-group:hover {
    color: var(--primary);
}

.docs-toc-group .bi-chevron-down {
    font-size: 11px;
    transition: transform .2s;
    margin-right: 14px;
    color: #8a93a6;
}

.docs-toc-group[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.docs-toc-sub {
    border-left: 2px solid #e9edf5;
    margin-left: 6px;
}

.docs-toc-sub a {
    padding: 7px 0 7px 22px;
    font-size: 13.5px;
    font-weight: 500;
}

/* Leaf-level subsections inside a module */
.docs-leaf {
    padding-top: 26px;
    margin-top: 26px;
    border-top: 1px dashed #e9edf5;
}

.docs-leaf:first-of-type {
    border-top: none;
    margin-top: 20px;
    padding-top: 0;
}

.docs-leaf h4 {
    font-size: 18px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 12px;
    scroll-margin-top: 100px;
}

.docs-leaf-flow {
    background: #fafcff;
    border: 1px solid #edf1f7;
    border-radius: 14px;
    padding: 10px 4px;
    margin-bottom: 16px;
    overflow-x: auto;
}

.docs-leaf-flow img {
    display: block;
    margin: 0 auto;
    height: auto;
    max-width: 100%;
}

.docs-leaf p {
    color: #5f6777;
    font-size: 14.5px;
    max-width: 760px;
    margin-bottom: 14px;
}

.docs-field-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    margin-bottom: 4px;
}

.docs-field-table th {
    text-align: left;
    color: #8a93a6;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
    padding: 6px 14px 6px 0;
    border-bottom: 1px solid #e9edf5;
}

.docs-field-table td {
    padding: 7px 14px 7px 0;
    border-bottom: 1px solid #f1f4f9;
    vertical-align: top;
}

.docs-field-table td:first-child {
    font-weight: 700;
    color: var(--dark);
    white-space: nowrap;
}

.docs-field-table code {
    background: #eef5ff;
    color: var(--primary);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12.5px;
}

.docs-leaf-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: #8a93a6;
    margin-bottom: 10px;
}

.docs-leaf-meta code {
    background: #f4f7fb;
    padding: 2px 8px;
    border-radius: 5px;
    color: #333;
}

@media (max-width: 991px) {
    .docs-layout {
        flex-direction: column;
    }
    .docs-toc {
        position: static;
        flex: 0 0 auto;
        width: 100%;
        max-height: none;
        border-bottom: 1px solid #e9edf5;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }
    .docs-fields {
        grid-template-columns: 1fr;
    }
    .docs-field-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
