html {
    scrollbar-width: thin;
    scrollbar-color: var(--bs-scrollbar-color) transparent;
}
html::-webkit-scrollbar {
    width: var(--bs-scrollbar-size);
    height: var(--bs-scrollbar-size);
}
html::-webkit-scrollbar-track {
    background-color: transparent;
}
html::-webkit-scrollbar-thumb {
    background-color: var(--bs-scrollbar-color);
    border-radius: var(--bs-scrollbar-size);
}
html:hover::-webkit-scrollbar-thumb {
    background-color: var(--bs-scrollbar-hover-color);
}
html::-webkit-scrollbar-corner {
    background-color: transparent;
}

@media (max-width: 767px) {
    .daterangepicker {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%) !important;
        max-height: 90vh;
        overflow-y: auto;
        overflow-x: hidden;
    }
    .daterangepicker:before,
    .daterangepicker:after {
        display: none !important;
    }
    .daterangepicker .drp-selected {
        display: block;
        margin-bottom: 1.25rem;
        margin-top: 0.5rem;
    }
}

table.dataTable { table-layout: auto !important; }
table.dataTable > colgroup > col { width: auto !important; }

table.dataTable > thead > tr > th {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
table.dataTable > thead > tr > th.dt-orderable-asc,
table.dataTable > thead > tr > th.dt-orderable-desc,
table.dataTable > thead > tr > th.dt-ordering-asc,
table.dataTable > thead > tr > th.dt-ordering-desc {
    padding-left: 1.75rem;
    padding-right: 1.75rem;
}

table.dataTable > thead > tr > th.dt-orderable-none {
    padding-right: 1.5rem;
}

:root {
    --docs-bg-code:        #f6f8fb;
    --docs-bg-code-tab:    #eef1f6;
    --docs-fg-code:        #2b2d3a;
    --docs-fg-code-muted:  #6b7280;

    --docs-border:         var(--bs-gray-400);
    --docs-radius:         0.625rem;
    --docs-radius-sm:      0.5rem;
    --docs-mono:          'JetBrains Mono', 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
[data-bs-theme="dark"], html[data-theme="dark"] {
    --docs-bg-code:        #15171f;
    --docs-bg-code-tab:    #1c1f2a;
    --docs-fg-code:        #e3e6ee;
    --docs-fg-code-muted:  #8a91a3;
    --docs-border:         var(--bs-gray-100);
}

.docs-page-title { font-size: 1.5rem; font-weight: 700; color: var(--bs-gray-900); margin: 0; line-height: 1.2; }
.docs-search { position: relative; max-width: 360px; width: 100%; }
.docs-search input {
    padding-left: 2.5rem; height: 40px;
    background: var(--bs-body-bg);
    border: 1px solid var(--docs-border);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.docs-search input:focus { border-color: var(--bs-primary); box-shadow: 0 0 0 0.2rem rgba(80,123,255,0.12); }
.docs-search i { position: absolute; top: 50%; left: 0.875rem; transform: translateY(-50%); color: var(--bs-gray-500); }

.docs-toc {
    position: sticky; top: 96px;
    max-height: calc(100vh - 120px);
    overflow-y: auto; padding-right: 0.25rem;
}
@media (max-width: 991px) { .docs-toc { position: static; max-height: none; padding: 0.85rem; } }
.docs-toc::-webkit-scrollbar { width: 6px; }
.docs-toc::-webkit-scrollbar-thumb { background: var(--docs-border); border-radius: 3px; }
.docs-toc-link {
    display: flex; align-items: center;
    padding: 0.45rem 0.75rem; margin: 1px 0;
    border-radius: 0.4rem; color: var(--bs-gray-700);
    font-size: 0.85rem; font-weight: 500;
    text-decoration: none; transition: background 0.12s, color 0.12s;
}
.docs-toc-link:hover { background: var(--bs-gray-100); color: var(--bs-gray-900); }
.docs-toc-link.is-active { background: rgba(80,123,255,0.10); color: var(--bs-primary); font-weight: 600; }

[data-bs-theme="dark"] .docs-toc-link:hover, html[data-theme="dark"] .docs-toc-link:hover { background: rgba(255,255,255,0.06); color: var(--bs-gray-900); }
[data-bs-theme="dark"] .docs-toc-link.is-active, html[data-theme="dark"] .docs-toc-link.is-active { background: rgba(80,123,255,0.18); color: var(--bs-primary); }
.docs-toc-link code { color: inherit; background: transparent; padding: 2px 4px; font-size: 0.78rem; font-family: var(--docs-mono); }
.docs-toc-cat-row {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.55rem 0.75rem; border-radius: 0.4rem;
    color: var(--bs-gray-800); font-weight: 600; font-size: 0.92rem;
    cursor: pointer; user-select: none;
    transition: background 0.12s, color 0.12s;
}
.docs-toc-cat-row:hover { background: var(--bs-gray-100); }
.docs-toc-cat-row.is-active { background: var(--bs-gray-100); color: var(--bs-primary); }
[data-bs-theme="dark"] .docs-toc-cat-row:hover, html[data-theme="dark"] .docs-toc-cat-row:hover { background: rgba(255,255,255,0.04); }
[data-bs-theme="dark"] .docs-toc-cat-row.is-active, html[data-theme="dark"] .docs-toc-cat-row.is-active { background: rgba(255,255,255,0.06); }
.docs-toc-cat-row .docs-toc-icon { display: inline-flex; align-items: center; gap: 0.15rem; color: var(--bs-primary); }
.docs-toc-cat-row .docs-count {
    margin-left: auto; font-size: 0.7rem; color: var(--bs-gray-600);
    background: var(--bs-gray-100); padding: 1px 8px; border-radius: 999px; font-weight: 600;
}
[data-bs-theme="dark"] .docs-toc-cat-row .docs-count, html[data-theme="dark"] .docs-toc-cat-row .docs-count { background: rgba(255,255,255,0.06); color: var(--bs-gray-400); }
.docs-toc-cat-row.is-active .docs-count { background: rgba(80,123,255,0.15); color: var(--bs-primary); }
.docs-toc-children { padding-left: 0.5rem; border-left: 1px solid var(--docs-border); margin: 0.25rem 0 0.5rem 1.1rem; }

.docs-section { display: none; animation: docsFade 0.18s ease-out; }
.docs-section.is-active { display: block; }
@keyframes docsFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.docs-section-head { display: flex; align-items: center; gap: 1rem; margin: 1rem 0 2rem; flex-wrap: wrap; }
.docs-section-head .docs-section-icons { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--bs-primary); }
.docs-section-head h1 { font-size: 1.625rem; font-weight: 700; color: var(--bs-gray-900); margin: 0; line-height: 1.2; }
.docs-section-head .docs-section-count {
    font-size: 0.875rem; font-weight: 600; color: var(--bs-gray-700);
    background: var(--bs-gray-100); padding: 4px 12px; border-radius: 999px;
}
[data-bs-theme="dark"] .docs-section-head .docs-section-count, html[data-theme="dark"] .docs-section-head .docs-section-count { background: rgba(255,255,255,0.06); color: var(--bs-gray-300); }
.docs-section-sub { color: var(--bs-gray-600); font-size: 0.92rem; margin: -0.5rem 0 1.5rem; }

.docs-endpoint { scroll-margin-top: 96px; margin-bottom: 1.5rem; }
.docs-endpoint .card-header {
    border-bottom: 1px solid var(--docs-border);
    padding: 1.5rem 1.75rem;
    min-height: auto;
    display: block;
}
.docs-endpoint .card-body { padding: 0.5rem 1.75rem 1rem 1.75rem; }
.docs-method {
    font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em;
    padding: 5px 12px; border-radius: 5px;
    background: rgba(80,123,255,0.12); color: var(--bs-primary);
    font-family: var(--docs-mono);
    display: inline-block;
}
.docs-path {
    font-family: var(--docs-mono);
    font-size: 1.2rem; font-weight: 600;
    color: var(--bs-gray-900); letter-spacing: -0.01em;
    word-break: break-all;
}
.docs-summary {
    color: var(--bs-gray-700);
    font-size: 1rem; line-height: 1.55;
    max-width: 760px;
    margin: 0.65rem 0 0;
}
.docs-summary code { background: var(--docs-bg-code-tab); padding: 1px 6px; border-radius: 3px; font-family: var(--docs-mono); font-size: 0.92em; color: var(--bs-gray-800); }

.docs-detail-note {
    background: rgba(80,123,255,0.06);
    border-left: 3px solid var(--bs-primary);
    color: var(--bs-gray-800);
    padding: 0.75rem 1rem; border-radius: 0 0.4rem 0.4rem 0;
    font-size: 0.875rem; line-height: 1.55; margin-bottom: 1.25rem;
}
[data-bs-theme="dark"] .docs-detail-note, html[data-theme="dark"] .docs-detail-note { color: var(--bs-gray-700); background: rgba(80,123,255,0.10); }
.docs-detail-note code { background: transparent; padding: 0 2px; color: var(--bs-primary); font-size: 0.9em; }

.docs-h {
    font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--bs-gray-600); margin: 1.5rem 0 0.75rem;
}
.docs-h:first-child { margin-top: 0; }

.docs-table-wrap {
    background: transparent;
    box-shadow: inset 0 0 0 1.25px var(--docs-border);
    border-radius: var(--docs-radius-sm);
    overflow: hidden;
}
.docs-table-wrap > .table-responsive { overflow-x: auto; }

.docs-params, .docs-errors {
    margin-bottom: 0;
    border-collapse: collapse;
}

.docs-params.table > :not(:first-child),
.docs-errors.table > :not(:first-child) { border-top: 0; }

.docs-params thead th, .docs-errors thead th {
    background: transparent;
    border-bottom: 1px solid var(--docs-border) !important;
    padding: 0.85rem 0.75rem;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: var(--bs-gray-800) !important;
    vertical-align: middle;
    line-height: 1.3;
}
.docs-params tbody td, .docs-errors tbody td {
    border-bottom: 1px solid var(--docs-border);
    padding: 0.85rem 0.75rem;
    vertical-align: middle;
    background: transparent;
}
.docs-params tbody tr:last-child td,
.docs-errors tbody tr:last-child td { border-bottom: 0; }

.docs-params { font-size: 0.85rem; }
.docs-params .docs-param-name {
    font-family: var(--docs-mono); font-weight: 600;
    color: var(--bs-gray-900); font-size: 0.85rem;
}
.docs-params .docs-param-type { font-family: var(--docs-mono); font-size: 0.78rem; color: var(--bs-gray-600); }
.docs-params .docs-pill-required, .docs-params .docs-pill-optional {
    display: inline-block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em;
    padding: 2px 9px; border-radius: 3px; text-transform: uppercase;
}
.docs-params .docs-pill-required { background: rgba(241, 65, 108, 0.12); color: #d3164a; }
.docs-params .docs-pill-optional { background: var(--bs-gray-100); color: var(--bs-gray-600); }
[data-bs-theme="dark"] .docs-params .docs-pill-optional, html[data-theme="dark"] .docs-params .docs-pill-optional { background: rgba(255,255,255,0.05); color: var(--bs-gray-400); }
.docs-params .docs-default {
    font-family: var(--docs-mono); font-size: 0.78rem;
    background: var(--docs-bg-code-tab); padding: 1px 7px;
    border-radius: 3px; color: var(--bs-gray-700);
    display: inline-block;
}
.docs-params .docs-choices { margin-top: 0.4rem; display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.docs-params .docs-choices code { font-family: var(--docs-mono); font-size: 0.72rem; background: var(--docs-bg-code-tab); color: var(--bs-gray-700); padding: 1px 6px; border-radius: 3px; }
.docs-params .docs-desc-cell { line-height: 1.5; color: var(--bs-gray-700); }

.docs-params .docs-desc-cell code {
    font-family: var(--docs-mono);
    font-size: 0.85em;
    background: var(--docs-bg-code-tab);
    padding: 1px 6px;
    border-radius: 3px;
    color: var(--bs-gray-800);
}

.docs-errors { font-size: 0.85rem; }
.docs-errors .docs-status {
    display: inline-block; min-width: 48px;
    font-family: var(--docs-mono); font-weight: 700; font-size: 0.8rem;
    padding: 3px 10px; border-radius: 4px;
}
.docs-status.s-4xx { background: rgba(255, 174, 31, 0.14); color: #b86b00; }
.docs-status.s-5xx { background: rgba(241, 65, 108, 0.12); color: #d3164a; }
.docs-status.s-429 { background: rgba(255, 199, 0, 0.18); color: #a17a00; }
[data-bs-theme="dark"] .docs-status.s-4xx, html[data-theme="dark"] .docs-status.s-4xx { color: #ffb84d; }
[data-bs-theme="dark"] .docs-status.s-5xx, html[data-theme="dark"] .docs-status.s-5xx { color: #ff5e8a; }
[data-bs-theme="dark"] .docs-status.s-429, html[data-theme="dark"] .docs-status.s-429 { color: #ffd24d; }

.docs-code {
    background: var(--docs-bg-code);
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius);
    overflow: hidden;
    margin-bottom: 1rem;
}
.docs-code-tabs {
    display: flex; align-items: center; flex-wrap: wrap;
    background: var(--docs-bg-code-tab);
    border-bottom: 1px solid var(--docs-border);
    padding: 0 0.25rem;
}
.docs-code-tab {
    background: transparent; border: 0; padding: 0.55rem 0.85rem;
    font-size: 0.77rem; font-weight: 600; color: var(--docs-fg-code-muted);
    font-family: 'Inter', sans-serif; letter-spacing: -0.005em;
    border-bottom: 2px solid transparent; cursor: pointer;
    transition: color 0.12s, border-color 0.12s;
}
.docs-code-tab:hover { color: var(--docs-fg-code); }
.docs-code-tab.is-active { color: var(--bs-primary); border-bottom-color: var(--bs-primary); }
.docs-code-actions { margin-left: auto; padding-right: 0.4rem; }
.docs-code-copy {
    background: transparent; border: 0;
    font-size: 0.74rem; font-weight: 500; color: var(--docs-fg-code-muted);
    padding: 0.3rem 0.6rem; border-radius: 4px;
    cursor: pointer; transition: background 0.12s, color 0.12s;
    display: inline-flex; align-items: center; gap: 0.3rem;
}
.docs-code-copy:hover { background: rgba(0,0,0,0.04); color: var(--docs-fg-code); }
[data-bs-theme="dark"] .docs-code-copy:hover, html[data-theme="dark"] .docs-code-copy:hover { background: rgba(255,255,255,0.06); }
.docs-code-copy.is-copied { color: var(--bs-success); }
.docs-code pre {
    margin: 0; padding: 1rem 1.25rem;
    font-family: var(--docs-mono); font-size: 0.82rem; line-height: 1.65;
    color: var(--docs-fg-code);
    overflow-x: auto; white-space: pre;
    background: transparent;
}
.docs-code-pane { display: none; }
.docs-code-pane.is-active { display: block; }

.docs-tile-icon {
    width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

[data-bs-theme="dark"] .docs-tile-icon.bg-light-success,
html[data-theme="dark"] .docs-tile-icon.bg-light-success {
    background-color: rgba(var(--bs-success-rgb), 0.10) !important;
}

.docs-tile-p { white-space: pre-line; }

.docs-empty-search {
    display: none; text-align: center;
    padding: 3rem 1rem; color: var(--bs-gray-500); font-size: 0.95rem;
}
.docs-empty-search.is-visible { display: block; }
.docs-search-mode .docs-section { display: block; }
.docs-search-mode .docs-section-head, .docs-search-mode .docs-section-sub { display: none; }
.docs-search-mode .docs-overview-row { display: none; }

@media (max-width: 767px) {
    body.docs-page #kt_app_toolbar_container { flex-direction: column; align-items: stretch !important; gap: 0.75rem; }
    .docs-search { max-width: 100%; }
    .docs-page-title { font-size: 1.25rem; }
    .docs-section-head h1 { font-size: 1.25rem; }
    .docs-section-head { gap: 0.5rem; }
    .docs-endpoint .card-header { padding: 1.1rem 1.1rem 1rem; }
    .docs-endpoint .card-body { padding: 1.1rem; }
    .docs-method { font-size: 0.72rem; padding: 4px 10px; }
    .docs-path { font-size: 1.025rem; }
    .docs-summary { font-size: 0.92rem; }
    .docs-code pre { font-size: 0.78rem; padding: 0.85rem 1rem; }
    .docs-toc { padding: 0.75rem; }
    .docs-overview-tile { padding: 0.95rem 1.05rem; }
}

.card.card-flush.col-lg-custom-4 .card-body {
    min-height: 60px;
}

/* ── Fix: Metronic hardcodes padding-right:15px on the fixed header when
   a modal is open.  With scrollbar-width:thin the real scrollbar is ~10 px
   (or 0 px when the page doesn't scroll), so the 15 px over-compensates
   and the navbar items shift left.
   Override with a CSS variable that JS sets to the actual scrollbar width. */
@media (min-width: 992px) {
    [data-kt-app-header-fixed=true].modal-open .app-header {
        padding-right: var(--kt-header-modal-pr, 0px) !important;
    }
}

@media (max-width: 991.98px) {
    #kt_app_sidebar {
        overflow-y: auto;
        max-height: 100vh;
        max-height: 100dvh;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
}
