@font-face {
    font-family: "MingCute";
    src: url("/konrix-hg/fonts/MingCute.woff") format("woff");
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

:root {
    --kg-body: #f3f6f8;
    --kg-card: #ffffff;
    --kg-sidebar: #111827;
    --kg-sidebar-soft: #1f2937;
    --kg-primary: #3073f1;
    --kg-success: #0acf97;
    --kg-warning: #ffbc00;
    --kg-danger: #fa5c7c;
    --kg-info: #39afd1;
    --kg-text: #313a46;
    --kg-muted: #8391a2;
    --kg-border: #e5e7eb;
    --kg-radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--kg-text);
    background: var(--kg-body);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
}

html {
    scroll-behavior: smooth;
}

[class^="mgc_"],
[class*=" mgc_"] {
    font-family: "MingCute";
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    line-height: 1;
    text-transform: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.mgc_home_3_line:before { content: "\ed51"; }
.mgc_box_3_line:before { content: "\ea2f"; }
.mgc_folder_2_line:before { content: "\ec97"; }
.mgc_coupon_line:before { content: "\eb2b"; }
.mgc_user_3_line:before { content: "\f127"; }
.mgc_alarm_2_line:before { content: "\e91f"; }
.mgc_wallet_4_line:before { content: "\f15f"; }
.mgc_notification_line:before { content: "\ee95"; }
.mgc_menu_line:before { content: "\ee35"; }
.mgc_settings_3_line:before { content: "\efe1"; }
.mgc_chart_bar_line:before { content: "\eab3"; }
.mgc_search_line:before { content: "\efc9"; }
.mgc_close_line:before { content: "\eae7"; }
.mgc_store_2_line:before { content: "\f059"; }
.mgc_calendar_line:before { content: "\ea73"; }

.wrapper {
    min-height: 100vh;
    display: flex;
}

.app-menu {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: 260px;
    background: var(--kg-sidebar);
    border-inline-end: 1px solid rgba(255, 255, 255, .06);
    z-index: 20;
    transition: width .2s ease, transform .2s ease;
}

.logo-box {
    height: 70px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    color: #fff;
    text-decoration: none;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0;
}

.logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--kg-primary), var(--kg-success));
    color: #fff;
    font-weight: 800;
}

.menu {
    margin: 0;
    padding: 14px 14px 28px;
    list-style: none;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    scrollbar-width: thin;
}

.mobile-backdrop {
    display: none;
}

.menu-title {
    padding: 16px 12px 8px;
    color: #778195;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.menu-link {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--kg-radius);
    color: #aab4c4;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.menu-link:hover,
.menu-link.active {
    background: var(--kg-sidebar-soft);
    color: #fff;
}

.menu-icon {
    width: 22px;
    display: grid;
    place-items: center;
    font-size: 20px;
}

.page-content {
    width: 100%;
    min-height: 100vh;
    margin-inline-start: 260px;
}

.app-header {
    position: sticky;
    top: 0;
    height: 70px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: rgba(255, 255, 255, .88);
    border-bottom: 1px solid var(--kg-border);
    backdrop-filter: blur(14px);
}

.icon-btn {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--kg-border);
    border-radius: var(--kg-radius);
    background: #fff;
    color: var(--kg-text);
    cursor: pointer;
}

.mobile-menu-btn {
    display: none;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

.page-main {
    padding: 24px;
    max-width: 1680px;
}

.page-title-box {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.page-title-box h1 {
    margin: 0;
    color: #111827;
    font-size: 24px;
    line-height: 1.2;
    letter-spacing: 0;
}

.page-title-box p {
    margin: 7px 0 0;
    color: var(--kg-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: var(--kg-radius);
    background: var(--kg-primary);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.btn-soft {
    border-color: #dbeafe;
    background: #eff6ff;
    color: var(--kg-primary);
}

.btn-success {
    background: var(--kg-success);
    color: #fff;
}

.btn-sm {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 12px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.input {
    min-height: 38px;
    min-width: 220px;
    border: 1px solid var(--kg-border);
    border-radius: var(--kg-radius);
    background: #fff;
    padding: 8px 12px;
    color: var(--kg-text);
}

.alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: var(--kg-radius);
    background: rgba(10, 207, 151, .12);
    color: #07956e;
    font-weight: 600;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, .9fr) minmax(0, 1.1fr);
    background: #edf3f8;
}

.auth-brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 42px;
    background: linear-gradient(135deg, #111827, #1e3a8a);
    color: #fff;
}

.auth-card-wrap {
    display: grid;
    place-items: center;
    padding: 28px;
}

.auth-card {
    width: min(440px, 100%);
}

.auth-title {
    margin: 0 0 8px;
    font-size: 28px;
}

.auth-subtitle {
    margin: 0 0 22px;
    color: var(--kg-muted);
}

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    margin-bottom: 7px;
    color: var(--kg-muted);
    font-weight: 700;
    font-size: 13px;
}

.field .input {
    width: 100%;
}

.error-text {
    margin-top: 8px;
    color: var(--kg-danger);
    font-size: 13px;
}

.grid {
    display: grid;
    gap: 18px;
}

.metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 22px;
}

.content-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
}

.card {
    border: 1px solid var(--kg-border);
    border-radius: var(--kg-radius);
    background: var(--kg-card);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    min-width: 0;
}

.card-body {
    padding: 20px;
}

.card-title {
    margin: 0;
    color: #111827;
    font-size: 16px;
    font-weight: 700;
}

.card-header {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--kg-border);
}

.metric-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.metric-label {
    margin: 0;
    color: var(--kg-muted);
    font-size: 13px;
}

.metric-value {
    margin: 10px 0 0;
    color: #111827;
    font-size: 28px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0;
}

.avatar-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: var(--kg-radius);
    color: #fff;
    font-size: 22px;
}

.bg-primary {
    background: var(--kg-primary);
}

.bg-success {
    background: var(--kg-success);
}

.bg-warning {
    background: var(--kg-warning);
}

.bg-info {
    background: var(--kg-info);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--kg-border);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.table td:first-child,
.table th:first-child {
    padding-inline-start: 20px;
}

.table th {
    color: var(--kg-muted);
    background: #f9fafb;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

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

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

.product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 260px;
}

.thumb {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    overflow: hidden;
    border-radius: var(--kg-radius);
    background: #eef2f7;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    background: rgba(10, 207, 151, .12);
    color: #07956e;
}

.badge-warning {
    background: rgba(255, 188, 0, .16);
    color: #946b00;
}

.badge-primary {
    background: rgba(48, 115, 241, .12);
    color: var(--kg-primary);
}

.empty {
    padding: 22px 20px;
    color: var(--kg-muted);
}

.detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
}

.detail-item {
    padding: 16px 20px;
}

.detail-label {
    margin: 0 0 6px;
    color: var(--kg-muted);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
}

.detail-value {
    margin: 0;
    color: #111827;
    font-weight: 700;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 20px;
}

.pagination a,
.pagination span {
    min-width: 34px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--kg-border);
    border-radius: var(--kg-radius);
    background: #fff;
    color: var(--kg-text);
    text-decoration: none;
    padding: 6px 10px;
}

.pagination .active span {
    border-color: var(--kg-primary);
    background: var(--kg-primary);
    color: #fff;
}

.chart-card {
    min-height: 100%;
}

.bar-chart {
    display: grid;
    gap: 12px;
}

.bar-row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) 72px;
    align-items: center;
    gap: 12px;
}

.bar-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef2f7;
}

.bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--kg-primary), var(--kg-success));
}

.footer {
    padding: 16px 24px 24px;
    color: var(--kg-muted);
    font-size: 13px;
}

@media (max-width: 1280px) {
    .metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .content-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .page-title-box {
        display: grid;
    }

    .form-row {
        width: 100%;
    }
}

@media (max-width: 820px) {
    .app-menu {
        position: fixed;
        top: 0;
        bottom: 0;
        width: 260px;
        transform: translateX(-100%);
        border-inline-end: 1px solid rgba(255, 255, 255, .08);
    }

    body.sidebar-open .app-menu {
        transform: translateX(0);
    }

    body.sidebar-open .mobile-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 15;
        background: rgba(15, 23, 42, .45);
    }

    .page-content {
        margin-inline-start: 0;
    }

    .logo-box {
        height: 70px;
        padding-inline: 24px;
    }

    .menu-link {
        min-height: 42px;
        padding: 10px 12px;
    }

    .menu-icon {
        font-size: 20px;
        width: 22px;
    }

    .app-header {
        height: auto;
        min-height: 62px;
        position: sticky;
        top: 0;
        padding-block: 10px;
    }

    .mobile-menu-btn {
        display: inline-grid;
    }

    .header-title {
        min-width: 0;
    }

    .header-title > span:last-child {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .metrics,
    .content-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .app-header,
    .page-main {
        padding-inline: 16px;
    }

    .page-main {
        padding-block-start: 18px;
    }

    .page-title-box h1 {
        font-size: 22px;
    }

    .metric-value {
        font-size: 25px;
    }

    .input {
        min-width: 100%;
    }

    .form-row .btn {
        width: 100%;
    }

    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        display: none;
    }

    .bar-row {
        grid-template-columns: 90px minmax(0, 1fr) 52px;
    }
}

@media (max-width: 520px) {
    body {
        font-size: 13px;
    }

    .app-header {
        gap: 10px;
    }

    .app-header .btn {
        min-height: 34px;
        padding-inline: 10px;
        font-size: 12px;
    }

    .card-body,
    .card-header,
    .detail-item {
        padding: 15px;
    }

    .table th,
    .table td {
        padding: 12px 14px;
    }

    .avatar-icon {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        font-size: 18px;
    }
}
