@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
}

html,
body {
    background: #ffffff !important;
}

.kb-file-manager {
    --kb-bg: #ffffff;
    --kb-panel: #fafafa;
    --kb-border: #e5e7eb;
    --kb-text: #111827;
    --kb-muted: #6b7280;
    --kb-subtle: #f3f4f6;
    --kb-active: #eeeeef;
    --kb-shadow: 0 18px 48px rgba(17, 24, 39, 0.055);
    min-height: 760px;
    margin: 0;
    background: var(--kb-bg);
    color: var(--kb-text);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: 0;
}

.kb-file-manager *:not(.ti):not([class^="ti-"]):not([class*=" ti-"]) {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

.kb-file-manager p,
.kb-file-manager strong,
.kb-file-manager span:not(.ti),
.kb-file-manager a,
.kb-file-manager button,
.kb-file-manager input,
.kb-file-manager label,
.kb-file-manager th,
.kb-file-manager td,
.kb-file-manager h1,
.kb-file-manager h2,
.kb-file-manager h3,
.kb-file-manager h4,
.kb-file-manager small {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

.kb-file-manager button,
.kb-file-manager input,
.kb-file-manager table {
    font: inherit;
}

.kb-app-header { display: none; }

.kb-brand {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    min-width: 240px;
    color: var(--kb-text);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.kb-brand:hover {
    color: var(--kb-text);
    text-decoration: none;
}

.kb-brand-mark {
    width: 38px;
    height: 38px;
    border-right: 1px solid var(--kb-border);
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    color: var(--kb-text);
    font-size: 24px;
}

.kb-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    flex: 1;
}

.kb-global-search {
    width: min(520px, 42vw);
    height: 48px;
    border: 1px solid #dfe4ec;
    border-radius: 14px;
    background: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 0 14px;
    position: relative;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.045);
}

.kb-global-search > i {
    color: #8b95a5;
    font-size: 19px;
}

.kb-global-search input {
    width: 100%;
    min-width: 0;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    color: var(--kb-text);
    padding: 0 !important;
    height: auto !important;
    font-size: 14px;
    font-weight: 400;
}

.kb-global-search input::placeholder {
    color: #8b93a3;
}

.kb-search-shortcut {
    color: var(--kb-muted);
    font-size: 12px;
    white-space: nowrap;
}

.kb-search-submit {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border: 0;
    border-radius: 50%;
    background: #185fa5;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
}

.kb-search-submit:hover {
    background: #0f4f8e;
}

.kb-icon-button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    color: var(--kb-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 21px;
}

.kb-icon-button:hover {
    background: var(--kb-subtle);
}

.kb-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 34%, #f2c7af 0 18%, transparent 19%),
        radial-gradient(circle at 50% 92%, #374151 0 34%, transparent 35%),
        #d1d5db;
    border: 1px solid #d1d5db;
    display: inline-block;
}

.kb-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    min-height: 760px;
    margin-top: 20px;
    border-top: 1px solid var(--kb-border);
    border-bottom: 1px solid var(--kb-border);
}

.kb-sidebar {
    border-right: 1px solid var(--kb-border);
    background: #fbfbfd;
    padding: 0;
    overflow: hidden;
    min-height: 760px;
    display: flex;
    flex-direction: column;
}

.kb-sidebar-top {
    display: grid;
    gap: 0;
    margin-bottom: 0;
}

.kb-sidebar-top h2 {
    margin: 0;
    min-height: 58px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--kb-border);
    background: #ffffff;
    font-size: 15px;
    font-weight: 600;
}

.kb-sidebar-search {
    display: none !important;
}

.kb-sidebar-search i {
    color: var(--kb-muted);
}

.kb-sidebar-search input {
    width: 100%;
    min-width: 0;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.kb-sidebar-label {
    margin: 0;
    padding: 18px 24px 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    color: var(--kb-muted);
    text-transform: uppercase;
}

.kb-tree {
    display: block;
    padding: 0 24px 28px;
    overflow: auto;
    flex: 1;
    align-content: start;
}

.kb-tree-product-group,
.kb-tree-branch {
    display: block;
    width: 100%;
}

.kb-tree-children {
    display: none;
    margin-left: 22px;
    padding-left: 16px;
    border-left: 1px solid #d8dee8;
}

.kb-tree-children.is-open {
    display: block;
}

.kb-tree-branch {
    position: relative;
}

.kb-tree-branch::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 19px;
    width: 13px;
    height: 1px;
    background: #d8dee8;
}

.kb-tree-articles {
    display: block;
    margin-left: 20px;
    padding-left: 15px;
    border-left: 1px solid #d8dee8;
}

.kb-tree-row {
    width: 100%;
    height: 40px;
    min-height: 40px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--kb-text);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    margin: 0 0 4px;
}

.kb-tree-chevron {
    color: #8b95a5 !important;
    font-size: 13px !important;
    transition: transform 160ms ease;
    width: 14px;
    min-width: 14px;
}

.kb-tree-chevron.is-open {
    transform: rotate(90deg);
}

.kb-tree-row:hover,
.kb-tree-row.is-active {
    background: var(--kb-active);
    color: var(--kb-text);
    text-decoration: none;
}

.kb-tree-row i {
    color: #111827;
    font-size: 17px;
    width: 18px;
    min-width: 18px;
    text-align: center;
}

.kb-tree-name {
    flex: 1 1 auto !important;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    line-height: 1.2;
    display: block !important;
    width: auto !important;
    max-width: none !important;
}

.kb-tree-product .kb-tree-name {
    text-align: left;
}

.kb-tree-count {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 30px !important;
    max-width: 46px !important;
    height: 24px !important;
    margin: 0 0 0 auto !important;
    padding: 0 8px !important;
    border-radius: 999px;
    background: #ffffff;
    color: var(--kb-text);
    font-size: 11px !important;
    font-style: normal !important;
    line-height: 24px !important;
    text-align: center;
    box-shadow: inset 0 0 0 1px var(--kb-border);
    white-space: nowrap !important;
    overflow: hidden;
}

.kb-tree-article {
    color: #374151;
}

.kb-main-panel {
    min-width: 0;
    padding: 0;
    background: #ffffff;
}

.kb-content-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 58px;
    margin-bottom: 0;
    padding: 24px;
    border-bottom: 1px solid var(--kb-border);
    background: #ffffff;
}

.kb-eyebrow {
    margin: 0 0 6px;
    color: var(--kb-muted);
    font-size: 12px;
    font-weight: 500;
}

.kb-content-head h1 {
    margin: 0;
    color: var(--kb-text);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.kb-folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 168px);
    justify-content: start;
    gap: 14px;
    padding: 24px;
    padding-bottom: 0px;
    margin-bottom: 0;
}

.kb-folder-card {
    width: 168px;
    min-height: 142px;
    border: 1px solid #e1e6ee;
    border-radius: 12px;
    background: #ffffff;
    color: var(--kb-text);
    padding: 13px 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 12px 34px rgba(17, 24, 39, 0.025);
    transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.kb-folder-card:hover,
.kb-folder-card.is-active {
    background: #f6f7f9;
    border-color: #d6dce6;
    box-shadow: 0 20px 54px rgba(17, 24, 39, 0.065);
    transform: translateY(-2px);
}

.kb-folder-art {
    width: 94px;
    height: 72px;
    position: relative;
    display: block;
    margin-bottom: 4px;
    filter: drop-shadow(0 14px 22px rgba(17, 24, 39, 0.13));
}

.kb-folder-tab,
.kb-folder-body {
    position: absolute;
    display: block;
    background: linear-gradient(150deg, #676767 0%, #3d3d3d 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.kb-folder-tab {
    left: 0;
    top: 0;
    width: 52px;
    height: 27px;
    border-radius: 10px 13px 0 0;
}

.kb-folder-body {
    left: 0;
    right: 0;
    bottom: 0;
    height: 58px;
    border-radius: 10px;
}

.kb-folder-art i {
    position: absolute;
    left: 7px;
    bottom: 7px;
    z-index: 2;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.kb-folder-card strong {
    max-width: 100%;
    color: var(--kb-text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

.kb-folder-card small {
    color: var(--kb-muted);
    font-size: 11px;
    line-height: 1.3;
}

.kb-articles-section {
    margin-top: 0;
    padding: 24px;
}

.kb-table-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
    padding-top: 8px;
}

.kb-table-head h2 {
    margin: 0;
    color: var(--kb-text);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.kb-article-context {
    display: inline-flex !important;
    align-items: center;
    min-height: 26px;
    margin-left: 10px;
    padding: 3px 10px;
    border: 1px solid #e1e6ee;
    border-radius: 999px;
    background: #f6f7f9;
    color: #6b7280;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.2;
    vertical-align: middle;
}

.kb-table-wrap {
    overflow: auto;
    border: 1px solid #e1e6ee;
    border-radius: 12px;
    background: #ffffff;
    margin-bottom: 0;
}

.kb-articles-table {
    width: 100%;
    min-width: 760px;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.kb-articles-table th,
.kb-articles-table td {
    height: 46px;
    padding: 0 14px;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 1px solid #e8edf3 !important;
    border-top: 0 !important;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kb-articles-table th {
    color: var(--kb-muted);
    color: #6f7787;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: #fbfbfd;
}

.kb-sort-btn {
   
    height: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: inherit;
    font-size: inherit;
    font-weight: inherit;
    cursor: pointer;
}

.kb-sort-btn i {
    color: #9aa3b2;
    font-size: 14px;
}

.kb-sort-btn.is-active {
    color: #111827;
}

.kb-sort-btn.is-active i {
    color: #185fa5;
}

.kb-articles-table td {
    color: var(--kb-text);
    font-size: 13px;
}

.kb-articles-table tr:last-child td {
    border-bottom: 0;
}

.kb-articles-table th:first-child,
.kb-articles-table td:first-child {
    padding-left: 18px;
}

.kb-articles-table th:nth-child(1),
.kb-articles-table td:nth-child(1) {
    width: 42%;
}

.kb-articles-table th:nth-child(2),
.kb-articles-table td:nth-child(2) {
    width: 7%;
     text-align: center;
}

.kb-articles-table th:nth-child(3),
.kb-articles-table td:nth-child(3) {
    width: 16%;
    display: none;
     text-align: center;
}

.kb-articles-table th:nth-child(4),
.kb-articles-table td:nth-child(4) {
    width: 7%;
    display: none;
    text-align: center;
}

.kb-articles-table th:nth-child(5),
.kb-articles-table td:nth-child(5) {
    width: 5%;
     text-align: center;
}

.kb-article-row:hover {
    background: #fafbfc;
}

.kb-article-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--kb-text);
    font-weight: 500;
    text-decoration: none;
    max-width: 100%;
}

.kb-article-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kb-article-link:hover {
    color: var(--kb-text);
    text-decoration: none;
}

.kb-article-link i {
    color: var(--kb-muted);
    font-size: 18px;
}

.kb-status {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    font-size: 12px;
    font-weight: 500;
}

.kb-open-article {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: #185fa5;
    color: #ffffff !important;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
}

.kb-open-article:hover {
    background: #0f4f8e;
    color: #ffffff !important;
}

.kb-table-pagination {
    min-height: 44px;
    margin-top: 10px;
    padding: 0 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--kb-muted);
    font-size: 12px;
}

.kb-table-pagination[hidden] {
    display: none !important;
}

.kb-pagination-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.kb-page-btn {
    height: 32px;
    border: 1px solid #dfe4ec;
    border-radius: 999px;
    background: #ffffff;
    color: var(--kb-text);
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.kb-page-btn:hover:not(:disabled) {
    background: #f3f4f6;
}

.kb-page-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.kb-page-indicator {
    min-width: 88px;
    text-align: center;
}

.kb-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 40;
    max-height: 360px;
    overflow: auto;
    border: 1px solid var(--kb-border);
    border-radius: 17px;
    background: #ffffff;
    box-shadow: var(--kb-shadow);
    padding: 0;
}

.kb-search-results[hidden] {
    display: none !important;
}

.kb-result-item {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 74px;
    padding: 14px 18px;
    border-radius: 0;
    border-bottom: 1px solid #eef2f6;
    color: var(--kb-text);
    text-decoration: none;
}

.kb-result-item:hover {
    background: #eef6ff;
    color: var(--kb-text);
    text-decoration: none;
}

.kb-result-item:first-child {
    border-radius: 17px 17px 0 0;
}

.kb-result-item:last-child {
    border-bottom: 0;
    border-radius: 0 0 17px 17px;
}

.kb-result-item:only-child {
    border-radius: 17px;
}

.kb-result-item i {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 12px;
    background: #e6f1fb;
    color: #185fa5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.kb-result-item span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.kb-result-item strong,
.kb-result-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kb-result-item strong {
    font-size: 15px;
    font-weight: 700;
}

.kb-result-item small,
.kb-results-state,
.kb-empty-cell {
    color: var(--kb-muted);
    font-size: 13px;
}

.kb-results-state {
    padding: 18px;
    text-align: center;
}

.kb-table-skeleton span {
    display: block;
    width: 75%;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f3f4f6, #e5e7eb, #f3f4f6);
    background-size: 240% 100%;
    animation: kb-loading 1.1s ease-in-out infinite;
}

.kb-mobile-bar {
    display: none;
}

@keyframes kb-loading {
    0% { background-position: 0% 50%; }
    100% { background-position: 240% 50%; }
}

@media (max-width: 1180px) {
    .kb-folder-grid {
        grid-template-columns: repeat(auto-fill, 160px);
    }

    .kb-main-panel {
        padding: 0;
    }
}

@media (max-width: 940px) {
    .kb-app-header {
        padding: 0 18px;
    }

    .kb-brand {
        min-width: auto;
    }

    .kb-global-search {
        width: min(340px, 52vw);
    }

    .kb-shell {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .kb-sidebar {
        padding: 0;
    }

    .kb-main-panel {
        padding: 0;
    }

    .kb-folder-grid {
        grid-template-columns: repeat(auto-fill, 154px);
        gap: 12px;
    }
}

@media (max-width: 720px) {
    .kb-app-header {
        height: auto;
        min-height: 70px;
        flex-wrap: wrap;
        padding: 14px 16px;
    }

    .kb-header-actions {
        width: 100%;
        justify-content: stretch;
        order: 2;
    }

    .kb-global-search {
        width: 100%;
    }

    .kb-search-shortcut,
    .kb-icon-button,
    .kb-avatar {
        display: none;
    }

    .kb-mobile-bar {
        display: flex;
        padding: 12px 16px;
        border-bottom: 1px solid var(--kb-border);
        background: #ffffff;
        position: sticky;
        top: 0;
        z-index: 15;
    }

    .kb-sidebar-toggle {
        height: 40px;
        border: 1px solid var(--kb-border);
        border-radius: 10px;
        background: #ffffff;
        color: var(--kb-text);
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 0 12px;
        cursor: pointer;
    }

    .kb-shell {
        display: block;
        min-height: 0;
    }

    .kb-sidebar {
        display: none;
        border-right: 0;
        border-bottom: 1px solid var(--kb-border);
        max-height: 70vh;
        min-height: 0;
    }

    .kb-sidebar.is-open {
        display: block;
    }

    .kb-main-panel {
        padding: 0;
    }

    .kb-content-head {
        min-height: auto;
        padding: 16px;
        margin-bottom: 0;
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .kb-folder-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 18px 16px;
    }

    .kb-folder-card {
        min-height: 138px;
    }

    .kb-table-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .kb-articles-section {
        padding: 0 16px 32px;
    }
}

@media (max-width: 420px) {
    .kb-brand {
        font-size: 15px;
    }

    .kb-brand-mark {
        width: 32px;
    }

    .kb-folder-art {
        transform: scale(0.92);
        margin-bottom: 0;
    }

    .kb-folder-card {
        min-height: 128px;
        padding: 12px 10px;
    }
}

/* Hard isolation from theme button/text styles inside the KB sidebar. */
.kb-file-manager .kb-sidebar .kb-tree {
    display: block !important;
    align-content: start !important;
}

.kb-file-manager .kb-sidebar .kb-tree-product-group,
.kb-file-manager .kb-sidebar .kb-tree-branch {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
}

.kb-file-manager .kb-sidebar .kb-tree-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    margin: 0 0 4px !important;
    padding: 8px 10px !important;
    line-height: 1 !important;
}

.kb-file-manager .kb-sidebar .kb-tree-children {
    height: auto !important;
    min-height: 0 !important;
}

.kb-file-manager .kb-sidebar .kb-tree-children:not(.is-open) {
    display: none !important;
}

.kb-file-manager .kb-sidebar .kb-tree-children.is-open {
    display: block !important;
}

.kb-tree-product {
    list-style: none;
}

.kb-tree-product::-webkit-details-marker {
    display: none;
}

.kb-file-manager .kb-sidebar details.kb-tree-product-group:not([open]) > .kb-tree-children {
    display: none !important;
}

.kb-file-manager .kb-sidebar details.kb-tree-product-group[open] > .kb-tree-children {
    display: block !important;
}

.kb-file-manager .kb-sidebar details.kb-tree-product-group[open] > .kb-tree-product .kb-tree-chevron {
    transform: rotate(90deg);
}
