:root {
    --kolek-sidebar-width: 280px;
    --kolek-sidebar-collapsed-width: 64px;
    --kolek-topbar-height: 48px;
    --kolek-bg: #f4f4f4;
    --kolek-surface: #ffffff;
    --kolek-text: #111827;
    --kolek-muted: #8b929c;
    --kolek-line: #e6e6e6;
    --kolek-soft-line: #eeeeee;
    --kolek-dark: #171719;
    --kolek-active: #dcdcdc;
    --kolek-blue: #303f92;
    --kolek-green: #b8d49c;
    --kolek-danger: #ef3f35;
    --kolek-shadow: 0 1px 4px rgba(15, 23, 42, .08);
    --kolek-radius: 4px;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body.kolek-body {
    background: var(--kolek-bg);
    color: var(--kolek-text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

a {
    color: inherit;
}

.kolek-topbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    height: var(--kolek-topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--kolek-surface);
    border-bottom: 1px solid var(--kolek-soft-line);
}

.kolek-topbar-left {
    width: var(--kolek-sidebar-width);
    display: grid;
    grid-template-columns: 1fr 48px;
    align-items: center;
    height: 100%;
}

.kolek-brand {
    padding-left: 20px;
    color: #202124;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
}

.kolek-brand:hover {
    color: #202124;
}

.kolek-menu-toggle {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #111;
    font-size: 20px;
}

.kolek-menu-toggle:hover {
    background: #f1f1f1;
}

.kolek-topbar-right {
    display: flex;
    align-items: center;
    gap: 28px;
    padding-right: 32px;
    color: #050505;
    font-size: 14px;
}

.kolek-company-selector,
.kolek-user-menu {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.kolek-flag {
    position: relative;
    width: 16px;
    height: 11px;
    display: inline-block;
    overflow: hidden;
    border: 1px solid #9ab985;
    background: #1f9b45;
    font-size: 0;
}

.kolek-flag::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    background: #f5d547;
    transform: translate(-50%, -50%) rotate(45deg);
}

.kolek-flag::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #24449c;
    transform: translate(-50%, -50%);
}

.kolek-wrapper {
    min-height: 100vh;
    padding-top: var(--kolek-topbar-height);
}

.kolek-sidebar {
    position: fixed;
    inset: var(--kolek-topbar-height) auto 0 0;
    z-index: 900;
    width: var(--kolek-sidebar-width);
    display: flex;
    flex-direction: column;
    background: #f1f1f1;
    border-right: 1px solid var(--kolek-soft-line);
    overflow: hidden;
    transition: width .2s ease;
}

.kolek-sidenav {
    flex: 1;
    padding: 18px 20px;
    overflow-y: auto;
}

.kolek-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kolek-nav-item {
    margin-bottom: 2px;
}

.kolek-nav-link {
    height: 44px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 18px;
    color: #050505;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.kolek-nav-link i {
    width: 18px;
    min-width: 18px;
    color: #050505;
    font-size: 17px;
    text-align: center;
}

.kolek-nav-link:hover,
.kolek-nav-item.active .kolek-nav-link {
    background: var(--kolek-active);
    color: #050505;
}

.kolek-beta {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--kolek-dark);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
}

.kolek-sidebar-footer {
    padding: 12px 18px 66px;
}

.kolek-referral-btn {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 11px;
    background: #313f9a;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 5px 12px rgba(49, 63, 154, .35);
}

.kolek-referral-btn:hover {
    color: #fff;
    background: #293686;
}

.kolek-main {
    min-height: calc(100vh - var(--kolek-topbar-height));
    margin-left: var(--kolek-sidebar-width);
    display: flex;
    flex-direction: column;
    transition: margin-left .2s ease;
}

.kolek-page-header,
.kolek-page {
    margin: 16px 20px 0;
}

.kolek-page-header {
    min-height: 100px;
    padding: 22px;
    background: var(--kolek-surface);
    border: 1px solid var(--kolek-soft-line);
    border-radius: var(--kolek-radius);
    box-shadow: var(--kolek-shadow);
}

.kolek-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.kolek-title-row h1,
.kolek-page-header h1 {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #111;
    font-size: 21px;
    font-weight: 500;
}

.kolek-page-header h1 i {
    font-size: 17px;
}

.kolek-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    color: var(--kolek-muted);
    font-size: 14px;
}

.kolek-breadcrumb a {
    color: #1d1d1d;
    text-decoration: none;
}

.kolek-breadcrumb i {
    font-size: 13px;
}

.kolek-page {
    flex: 1;
}

.kolek-card,
.kolek-table-wrapper,
.kolek-filters {
    min-width: 0;
    background: var(--kolek-surface);
    border: 1px solid var(--kolek-soft-line);
    border-radius: var(--kolek-radius);
    box-shadow: var(--kolek-shadow);
}

.kolek-card {
    padding: 22px;
}

.kolek-card-title {
    margin: 0 0 18px;
    color: #111;
    font-size: 20px;
    font-weight: 400;
}

.kolek-card-text {
    color: var(--kolek-text);
    font-size: 14px;
}

.kolek-muted {
    color: var(--kolek-muted);
}

.kolek-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 388px);
    gap: 18px;
}

.kolek-dashboard-side {
    min-width: 0;
    display: grid;
    gap: 18px;
    align-content: start;
}

.kolek-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.kolek-stat-card {
    min-height: 108px;
    padding: 22px;
    background: var(--kolek-surface);
    border: 1px solid var(--kolek-soft-line);
    border-radius: var(--kolek-radius);
    box-shadow: var(--kolek-shadow);
}

.kolek-stat-value {
    margin-bottom: 4px;
    color: #161616;
    font-size: 19px;
    font-weight: 400;
}

.kolek-stat-label,
.kolek-stat-period {
    color: var(--kolek-muted);
    font-size: 14px;
}

.kolek-form-row,
.kolek-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.kolek-filter-grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kolek-form-group label,
.kolek-filter-group label {
    display: block;
    margin-bottom: 8px;
    color: #222;
    font-size: 14px;
    font-weight: 400;
}

.kolek-form-group input,
.kolek-form-group select,
.kolek-filter-group input,
.kolek-filter-group select,
.kolek-search-box input,
.kolek-show-select select {
    height: 36px;
    border: 1px solid #dedede;
    border-radius: 4px;
    background: #fff;
    color: #111;
    font-size: 14px;
}

.kolek-form-group input,
.kolek-form-group select,
.kolek-filter-group input,
.kolek-filter-group select {
    width: 100%;
    padding: 6px 12px;
}

.kolek-chart-container {
    height: 360px;
    margin-top: 34px;
}

.btn-kolek-primary,
.btn-kolek-outline {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.btn-kolek-primary {
    border: 1px solid var(--kolek-dark);
    background: var(--kolek-dark);
    color: #fff;
}

.btn-kolek-primary:hover {
    color: #fff;
    background: #000;
}

.btn-kolek-outline {
    border: 1px solid #d8d8d8;
    background: #fff;
    color: #222;
    font-weight: 400;
}

.btn-kolek-outline:hover {
    background: #f6f6f6;
    color: #222;
}

.kolek-filters {
    margin-bottom: 18px;
}

.kolek-filters-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 22px 12px;
    border: 0;
    background: transparent;
    color: #111;
    font-size: 20px;
    font-weight: 400;
    text-align: left;
}

.kolek-filters-body {
    margin: 0 12px 18px;
    padding: 14px 10px 20px;
    border: 2px dashed #e4e4e4;
}

.kolek-table-toolbar,
.kolek-table-header,
.kolek-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
}

.kolek-table-header {
    border-bottom: 1px solid var(--kolek-soft-line);
}

.kolek-table-title {
    color: #111;
    font-size: 18px;
    font-weight: 400;
}

.kolek-search-box {
    width: 202px;
    display: flex;
    align-items: center;
    background: #fff;
}

.kolek-search-box input {
    width: 100%;
    padding: 6px 10px;
    border-right: 0;
    border-radius: 4px 0 0 4px;
    outline: 0;
}

.kolek-search-box button {
    width: 36px;
    height: 36px;
    border: 1px solid #dedede;
    border-left: 0;
    border-radius: 0 4px 4px 0;
    background: #fff;
    color: #9aa0a6;
}

.kolek-show-select {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.kolek-show-select select {
    min-width: 70px;
    padding: 6px 10px;
}

.kolek-table-scroll {
    overflow-x: auto;
}

.table-kolek {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: #fff;
}

.table-kolek th,
.table-kolek td {
    padding: 10px 20px;
    border-top: 1px solid var(--kolek-soft-line);
    color: #1f2937;
    font-size: 14px;
    text-align: left;
    vertical-align: middle;
}

.table-kolek th {
    color: #333;
    font-weight: 400;
    white-space: nowrap;
}

.table-kolek td {
    background: #fff;
}

.table-kolek tbody tr:hover td {
    background: #fafafa;
}

.table-kolek .empty-row td {
    height: 58px;
    color: #444;
    text-align: center;
}

.table-kolek .sortable {
    position: relative;
}

.table-kolek .sortable::after {
    content: "↕";
    float: right;
    color: #9aa0a6;
    font-size: 12px;
}

.kolek-table-footer {
    min-height: 48px;
    color: #333;
    border-top: 1px solid var(--kolek-soft-line);
}

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

.kolek-pagination button {
    min-width: 36px;
    min-height: 34px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #333;
}

.kolek-pagination button.active {
    background: var(--kolek-dark);
    color: #fff;
}

.kolek-pagination button:disabled {
    color: #b7b7b7;
}

.badge-kolek-dark,
.badge-kolek-green,
.badge-kolek-red,
.badge-kolek-gray {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 3px 6px;
    border-radius: 2px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-kolek-dark {
    background: var(--kolek-dark);
}

.badge-kolek-green {
    background: #caeab7;
    color: #168421;
    border-radius: 12px;
    text-transform: none;
}

.badge-kolek-red {
    background: var(--kolek-danger);
}

.badge-kolek-gray {
    background: #9b9b9b;
}

.kolek-toggle {
    position: relative;
    width: 38px;
    height: 20px;
    display: inline-block;
}

.kolek-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.kolek-toggle-slider {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: #c3d7a5;
}

.kolek-toggle-slider::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 1px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}

.kolek-settings-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    color: #111;
}

.kolek-settings-row .row-label,
.kolek-settings-row .row-channels,
.kolek-channel-check {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kolek-inline-input {
    width: 54px;
    height: 28px;
    border: 0;
    border-bottom: 1px solid #777;
    background: transparent;
    text-align: center;
}

.kolek-settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
    gap: 18px;
    align-items: start;
}

.kolek-stack {
    min-width: 0;
    display: grid;
    gap: 18px;
}

.kolek-status-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
}

.kolek-actions {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.btn-action {
    border: 0;
    background: transparent;
    color: #111;
    font-size: 18px;
}

.kolek-chat-button {
    position: fixed;
    right: 20px;
    bottom: 18px;
    z-index: 1200;
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: #314487;
    color: #fff;
    box-shadow: 0 6px 16px rgba(49, 68, 135, .25);
}

.kolek-chat-button i {
    font-size: 30px;
}

.kolek-footer {
    margin: auto 20px 0;
    padding: 22px 0;
    color: #9aa0a6;
    font-size: 14px;
}

.kolek-footer a {
    color: #111;
    text-decoration: none;
}

body.sidebar-collapsed .kolek-topbar-left,
body.sidebar-collapsed .kolek-sidebar {
    width: var(--kolek-sidebar-collapsed-width);
}

body.sidebar-collapsed .kolek-brand,
body.sidebar-collapsed .kolek-nav-label,
body.sidebar-collapsed .kolek-beta,
body.sidebar-collapsed .kolek-sidebar-footer {
    display: none;
}

body.sidebar-collapsed .kolek-main {
    margin-left: var(--kolek-sidebar-collapsed-width);
}

body.sidebar-collapsed .kolek-sidenav {
    padding-left: 8px;
    padding-right: 8px;
}

body.sidebar-collapsed .kolek-nav-link {
    justify-content: center;
    padding: 0;
}

@media (max-width: 1180px) {
    .kolek-dashboard-grid,
    .kolek-settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .kolek-topbar-left,
    .kolek-sidebar {
        width: var(--kolek-sidebar-collapsed-width);
    }

    .kolek-brand,
    .kolek-nav-label,
    .kolek-beta,
    .kolek-sidebar-footer {
        display: none;
    }

    .kolek-main {
        margin-left: var(--kolek-sidebar-collapsed-width);
    }

    .kolek-topbar-right {
        gap: 12px;
        padding-right: 12px;
        font-size: 12px;
    }

    .kolek-company-name {
        max-width: 130px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .kolek-page-header,
    .kolek-page {
        margin-left: 12px;
        margin-right: 12px;
    }

    .kolek-form-row,
    .kolek-filter-grid,
    .kolek-filter-grid.cols-4,
    .kolek-stat-grid {
        grid-template-columns: 1fr;
    }

    .kolek-table-toolbar,
    .kolek-table-header,
    .kolek-table-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}
