/*
 * Aizubei reusable admin theme layer.
 * Keep page-specific CSS thin; put shared visual language here.
 */

:root {
    --az-primary: #1677ff;
    --az-primary-hover: #0f6ae6;
    --az-primary-soft: #eef5ff;
    --az-primary-border: #cfe2ff;
    --az-danger: #ff4d4f;
    --az-danger-soft: #fff1f2;
    --az-success: #18b76a;
    --az-success-soft: #eefaf5;
    --az-warning: #f59e0b;
    --az-warning-soft: #fff7e6;
    --az-text: #172033;
    --az-text-sub: #526073;
    --az-text-muted: #7b8898;
    --az-border: #dbe6f4;
    --az-border-soft: #e8eef7;
    --az-bg: #f5f8fc;
    --az-bg-soft: #f8fbff;
    --az-card: #fff;
    --az-table-head: #f7faff;
    --az-table-head-hover: #f3f8ff;
    --az-radius: 7px;
    --az-radius-sm: 5px;
    --az-shadow-sm: 0 1px 2px rgba(15, 23, 42, .03), 0 8px 24px rgba(15, 23, 42, .035);
    --az-shadow-md: 0 14px 34px rgba(15, 23, 42, .09);
}

html,
body {
    color: var(--az-text);
}

.content-wrapper,
.right-side {
    background: var(--az-bg);
}

.content {
    padding: 14px 16px;
}

.panel,
.box,
.nav-tabs-custom,
.bootstrap-table .fixed-table-container,
.bootstrap-table .commonsearch-table {
    border-color: var(--az-border-soft);
    border-radius: var(--az-radius);
    box-shadow: var(--az-shadow-sm);
}

.panel,
.box,
.nav-tabs-custom {
    background: var(--az-card);
}

.panel.panel-intro,
.box.box-primary,
.nav-tabs-custom {
    padding: 0;
    border: 1px solid var(--az-border-soft);
    overflow: hidden;
}

.panel.panel-intro > .panel-body {
    padding: 14px 16px 16px;
}

.panel-heading,
.box-header,
.nav-tabs-custom > .nav-tabs {
    border-color: var(--az-border-soft);
}

.panel-title,
.box-title {
    color: var(--az-text);
    font-weight: 700;
}

/* Sidebar */
.main-sidebar,
.left-side {
    background: linear-gradient(180deg, #203247 0%, #142235 100%);
}

.sidebar-menu > li > a {
    min-height: 42px;
    margin: 2px 10px;
    border-radius: var(--az-radius-sm);
    color: rgba(255, 255, 255, .88);
    font-weight: 600;
}

.sidebar-menu > li > a:hover,
.sidebar-menu > li.active > a,
.sidebar-menu > li.menu-open > a,
.sidebar-menu > li.treeview-open > a {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.sidebar-menu > li.active > a {
    box-shadow: inset 3px 0 0 #6fb2ff;
}

.sidebar-menu .treeview-menu {
    margin: 0 10px 4px;
    padding: 4px 0;
    border-radius: var(--az-radius-sm);
    background: rgba(9, 18, 31, .18);
}

.sidebar-menu .treeview-menu > li > a {
    margin: 1px 6px;
    border-radius: var(--az-radius-sm);
    color: rgba(255, 255, 255, .74);
}

.sidebar-menu .treeview-menu > li > a:hover,
.sidebar-menu .treeview-menu > li.active > a {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

/* Buttons */
.btn {
    border-radius: var(--az-radius-sm);
    box-shadow: none;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.btn:not(.btn-xs):not(.btn-sm):not(.btn-lg) {
    min-height: 32px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
}

.btn-xs {
    min-height: 24px;
    padding: 2px 7px;
    border-radius: var(--az-radius-sm);
    font-size: 12px;
    line-height: 18px;
}

.btn-primary {
    border-color: var(--az-primary);
    background: var(--az-primary);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    border-color: var(--az-primary-hover);
    background: var(--az-primary-hover);
    color: #fff;
}

.btn-default,
.btn-info {
    border-color: var(--az-border);
    background: #fff;
    color: var(--az-text-sub);
}

.btn-default:hover,
.btn-default:focus,
.btn-info:hover,
.btn-info:focus {
    border-color: #bfd8ff;
    background: var(--az-bg-soft);
    color: var(--az-primary);
}

.btn-danger {
    border-color: #ffd6d9;
    background: var(--az-danger-soft);
    color: var(--az-danger);
}

.btn-danger:hover,
.btn-danger:focus {
    border-color: var(--az-danger);
    background: var(--az-danger);
    color: #fff;
}

.btn-success {
    border-color: #c9f0dc;
    background: var(--az-success-soft);
    color: var(--az-success);
}

.btn-success:hover,
.btn-success:focus {
    border-color: var(--az-success);
    background: var(--az-success);
    color: #fff;
}

.btn-warning {
    border-color: #ffe3ad;
    background: var(--az-warning-soft);
    color: var(--az-warning);
}

.btn-warning:hover,
.btn-warning:focus {
    border-color: var(--az-warning);
    background: var(--az-warning);
    color: #fff;
}

.btn.disabled,
.btn[disabled],
fieldset[disabled] .btn {
    border-color: #e4ebf4 !important;
    background: #f8fafc !important;
    color: #a8b3c2 !important;
    opacity: 1;
}

.toolbar .btn,
.bootstrap-table .fixed-table-toolbar .btn,
.bootstrap-table .fixed-table-toolbar .toolbar .btn {
    min-height: 28px !important;
    height: 28px !important;
    padding: 3px 8px !important;
    border-radius: var(--az-radius-sm) !important;
    font-size: 12px;
    line-height: 20px;
}

.toolbar .btn .fa,
.bootstrap-table .fixed-table-toolbar .toolbar .btn .fa {
    margin-right: 3px;
}

/* Forms */
.form-control,
.bootstrap-select > .btn,
.bootstrap-tagsinput,
.sp_container .sp_input {
    border-color: var(--az-border);
    border-radius: var(--az-radius);
    background: #fff;
    color: #243044;
    box-shadow: none;
}

.form-control:focus,
.bootstrap-select.open > .btn,
.bootstrap-select > .btn:focus,
.bootstrap-tagsinput.focus,
.sp_container .sp_input:focus {
    border-color: #9cc7ff;
    box-shadow: 0 0 0 3px rgba(22, 119, 255, .08);
    outline: 0;
}

select.form-control {
    padding-right: 34px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fff;
    background-image:
        linear-gradient(45deg, transparent 50%, #7b8898 50%),
        linear-gradient(135deg, #7b8898 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

select.form-control::-ms-expand {
    display: none;
}

.input-group-addon {
    border-color: var(--az-border);
    background: #fff;
}

.bootstrap-select .dropdown-menu,
.sp_result_area,
.layui-layer-page .bootstrap-select .dropdown-menu,
.layui-layer-iframe .bootstrap-select .dropdown-menu {
    border: 1px solid var(--az-border);
    border-radius: var(--az-radius);
    background: #fff;
    box-shadow: var(--az-shadow-md);
    overflow: hidden;
}

.bootstrap-select .dropdown-menu > li > a {
    padding: 9px 13px;
    color: #344256;
}

.bootstrap-select .dropdown-menu > li > a:hover,
.bootstrap-select .dropdown-menu > li.selected > a {
    background: var(--az-bg-soft);
    color: var(--az-primary);
}

.bootstrap-tagsinput .tag,
ul.sp_element_box li.selected_tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin: 2px 4px 2px 0;
    padding: 2px 8px;
    border: 1px solid #d8e8ff;
    border-radius: 999px;
    background: var(--az-primary-soft);
    color: var(--az-primary);
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
}

.faupload,
.plupload {
    border-color: #d8e8ff !important;
    background: var(--az-primary-soft) !important;
    color: var(--az-primary) !important;
}

.fachoose {
    border-color: var(--az-border) !important;
    background: #fff !important;
    color: var(--az-text-sub) !important;
}

.faupload-preview .thumbnail,
.plupload-preview .thumbnail {
    border-color: var(--az-border-soft);
    border-radius: var(--az-radius);
    background: #fbfdff;
}

/* Radio and checkbox */
.radio {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.radio > label {
    display: inline-flex;
    align-items: center;
    position: relative;
    min-height: 32px;
    margin: 0;
    padding: 5px 13px 5px 32px;
    border: 1px solid var(--az-border);
    border-radius: 999px;
    background: #fff;
    color: var(--az-text-sub);
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
    overflow: visible;
}

.radio > label > input[type="radio"],
.radio > label > [class^="iradio_"],
.radio > label > [class*=" iradio_"] {
    position: absolute !important;
    left: 13px !important;
    top: 50% !important;
    width: 14px !important;
    height: 14px !important;
    margin: -7px 0 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.radio > label::before,
.radio > label::after {
    content: "";
    position: absolute;
    border-radius: 50%;
}

.radio > label::before {
    left: 13px;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border: 1px solid #b8c6d8;
    background: #fff;
}

.radio > label::after {
    left: 17px;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    background: transparent;
}

.radio > label:hover,
.radio > label.is-checked,
.radio > label:has(input[type="radio"]:checked),
.radio > label:has([class^="iradio_"].checked),
.radio > label:has([class*=" iradio_"].checked) {
    border-color: var(--az-primary-border);
    background: var(--az-primary-soft);
    color: var(--az-primary);
}

.radio > label.is-checked::before,
.radio > label:has(input[type="radio"]:checked)::before,
.radio > label:has([class^="iradio_"].checked)::before,
.radio > label:has([class*=" iradio_"].checked)::before {
    border-color: var(--az-primary);
}

.radio > label.is-checked::after,
.radio > label:has(input[type="radio"]:checked)::after,
.radio > label:has([class^="iradio_"].checked)::after,
.radio > label:has([class*=" iradio_"].checked)::after {
    background: var(--az-primary);
}

input[type="checkbox"] {
    accent-color: var(--az-primary);
}

body.is-dialog .content form.form-horizontal .checkbox {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding-top: 2px;
}

body.is-dialog .content form.form-horizontal .checkbox > label,
body.is-dialog .content form.form-horizontal .text-muted > input[type="checkbox"] + label {
    display: inline-flex;
    align-items: center;
    position: relative;
    min-height: 28px;
    margin: 0 10px 0 0;
    padding: 4px 10px 4px 28px;
    border: 1px solid transparent;
    border-radius: var(--az-radius-sm);
    color: var(--az-text-sub);
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

body.is-dialog .content form.form-horizontal .checkbox > label > input[type="checkbox"],
body.is-dialog .content form.form-horizontal .text-muted > input[type="checkbox"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body.is-dialog .content form.form-horizontal .checkbox > label::before,
body.is-dialog .content form.form-horizontal .text-muted > input[type="checkbox"] + label::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    width: 15px;
    height: 15px;
    margin-top: -8px;
    border: 1px solid #b8c6d8;
    border-radius: 4px;
    background: #fff;
    box-shadow: inset 0 1px 1px rgba(18, 32, 53, .04);
    box-sizing: border-box;
    transition: border-color .2s ease, background-color .2s ease;
}

body.is-dialog .content form.form-horizontal .checkbox > label::after,
body.is-dialog .content form.form-horizontal .text-muted > input[type="checkbox"] + label::after {
    content: "";
    position: absolute;
    left: 13px;
    top: 50%;
    width: 5px;
    height: 9px;
    margin-top: -6px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    opacity: 0;
    transform: rotate(45deg);
    transition: opacity .16s ease;
}

body.is-dialog .content form.form-horizontal .checkbox > label:hover,
body.is-dialog .content form.form-horizontal .checkbox > label.is-checked,
body.is-dialog .content form.form-horizontal .checkbox > label:has(input[type="checkbox"]:checked),
body.is-dialog .content form.form-horizontal .text-muted > input[type="checkbox"]:checked + label,
body.is-dialog .content form.form-horizontal .text-muted > input[type="checkbox"] + label.is-checked {
    border-color: var(--az-primary-border);
    background: var(--az-primary-soft);
    color: var(--az-primary);
}

body.is-dialog .content form.form-horizontal .checkbox > label.is-checked::before,
body.is-dialog .content form.form-horizontal .checkbox > label:has(input[type="checkbox"]:checked)::before,
body.is-dialog .content form.form-horizontal .text-muted > input[type="checkbox"]:checked + label::before,
body.is-dialog .content form.form-horizontal .text-muted > input[type="checkbox"] + label.is-checked::before {
    border-color: var(--az-primary);
    background: var(--az-primary);
}

body.is-dialog .content form.form-horizontal .checkbox > label.is-checked::after,
body.is-dialog .content form.form-horizontal .checkbox > label:has(input[type="checkbox"]:checked)::after,
body.is-dialog .content form.form-horizontal .text-muted > input[type="checkbox"]:checked + label::after,
body.is-dialog .content form.form-horizontal .text-muted > input[type="checkbox"] + label.is-checked::after {
    opacity: 1;
}

/* Search and tables */
.bootstrap-table .commonsearch-table {
    border-color: var(--az-border-soft);
    border-radius: var(--az-radius);
    background: #fff;
    box-shadow: none;
}

.bootstrap-table .commonsearch-table > tbody > tr > td {
    padding: 12px 16px;
    border-top: 0;
    background: #fff;
}

.bootstrap-table .form-commonsearch .form-control,
.bootstrap-table .form-commonsearch .bootstrap-select > .btn {
    height: 34px;
    min-height: 34px;
    border-radius: 7px;
}

.bootstrap-table .form-commonsearch button[type="submit"],
.bootstrap-table .form-commonsearch button[type="reset"] {
    height: 32px;
    min-width: 58px;
    border-radius: 7px;
    font-size: 12px;
}

.bootstrap-table .fixed-table-container {
    border-color: var(--az-border-soft);
    border-radius: var(--az-radius);
    background: #fff;
    overflow: hidden;
}

.bootstrap-table .table {
    margin-bottom: 0;
    color: var(--az-text);
}

.bootstrap-table .fixed-table-container thead th,
.bootstrap-table .table > thead > tr > th,
.table > thead > tr > th {
    height: 44px;
    border-left: 0 !important;
    border-right: 0 !important;
    border-top: 1px solid var(--az-border-soft) !important;
    border-bottom: 1px solid var(--az-border-soft) !important;
    background: var(--az-table-head) !important;
    color: #344256;
    font-size: 13px;
    font-weight: 700;
    line-height: 20px;
    vertical-align: middle !important;
    white-space: nowrap;
}

.bootstrap-table .fixed-table-container thead th .th-inner,
.bootstrap-table .table > thead > tr > th .th-inner {
    min-height: 44px;
    padding: 12px 12px;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: 20px;
}

.bootstrap-table .fixed-table-container thead th.bs-checkbox .th-inner,
.bootstrap-table .table > thead > tr > th.bs-checkbox .th-inner {
    padding-right: 10px;
    padding-left: 10px;
}

.bootstrap-table .fixed-table-container thead th:hover,
.bootstrap-table .table > thead > tr > th:hover,
.table > thead > tr > th:hover {
    background: var(--az-table-head-hover) !important;
}

.bootstrap-table .table > thead > tr > th .sortable {
    color: #344256;
}

.bootstrap-table .table > thead > tr > th:first-child,
.table > thead > tr > th:first-child {
    border-left: 0 !important;
}

.bootstrap-table .table > thead > tr > th:last-child,
.table > thead > tr > th:last-child {
    border-right: 0 !important;
}

.bootstrap-table .fixed-table-container tbody td .th-inner {
    padding: 9px 12px;
}

.bootstrap-table .table > tbody > tr > td,
.table > tbody > tr > td {
    padding: 12px;
    border-left: 0 !important;
    border-right: 0 !important;
    border-top-color: #eef3f8;
    color: #253247;
    font-size: 13px;
    line-height: 20px;
    vertical-align: middle;
}

.table-striped > tbody > tr:nth-of-type(odd) > td,
.table-striped > tbody > tr:nth-of-type(odd) > th {
    background: #fff;
}

.bootstrap-table .table > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > td {
    background: #f9fbff;
}

.bootstrap-table .az-table-clean > thead > tr > th,
.bootstrap-table .az-table-clean > tbody > tr > td {
    border-left: 0 !important;
    border-right: 0 !important;
}

.bootstrap-table .az-table-clean > thead > tr > th:first-child,
.bootstrap-table .az-table-clean > thead > tr > th:last-child {
    border-left: 0 !important;
    border-right: 0 !important;
}

.bootstrap-table .az-table-clean > thead > tr > th .th-inner {
    padding-top: 11px;
    padding-bottom: 11px;
}

.fixed-table-pagination .pagination > li > a,
.fixed-table-pagination .pagination > li > span,
.pagination > li > a,
.pagination > li > span {
    border-color: var(--az-border);
    color: var(--az-text-sub);
}

.fixed-table-pagination .pagination > .active > a,
.fixed-table-pagination .pagination > .active > span,
.pagination > .active > a,
.pagination > .active > span {
    border-color: var(--az-primary);
    background: var(--az-primary);
    color: #fff;
}

/* Agent info page */
.agent-info-page.panel {
    padding: 14px;
    border: 1px solid var(--az-border-soft);
    border-radius: var(--az-radius);
    background: #fff;
    box-shadow: var(--az-shadow-sm);
}

.agent-info-page > .panel-body {
    padding: 0;
}

.agent-info-page .agent-stat-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 14px;
    padding: 0;
}

.agent-info-page .agent-stat-grid .item {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 74px;
    width: auto;
    margin: 0;
    padding: 13px 14px;
    border: 1px solid var(--az-border-soft);
    border-radius: var(--az-radius);
    background: #fff;
    box-shadow: none;
}

.agent-info-page .agent-stat-grid .img {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    margin: 0;
    border: 1px solid var(--az-primary-border);
    border-radius: 12px;
    background: var(--az-primary-soft) !important;
    color: var(--az-primary) !important;
    font-size: 16px;
    line-height: 40px;
    text-align: center;
    z-index: 1;
}

.agent-info-page .agent-stat-grid .img::before {
    display: none !important;
    content: none !important;
}

.agent-info-page .agent-stat-grid .img.w_pink,
.agent-info-page .agent-stat-grid .img.w_green,
.agent-info-page .agent-stat-grid .img.w_purple,
.agent-info-page .agent-stat-grid .img.w_orange,
.agent-info-page .agent-stat-grid .img.w_rose {
    background: var(--az-primary-soft) !important;
    color: var(--az-primary) !important;
}

.agent-info-page .agent-stat-grid .text {
    display: block;
    min-width: 0;
    text-align: left;
}

.agent-info-page .agent-stat-grid .t_n {
    color: var(--az-text);
    font-size: 21px;
    font-weight: 750;
    line-height: 26px;
}

.agent-info-page .agent-stat-grid .t_p {
    margin-top: 3px;
    color: var(--az-text-muted);
    font-size: 12px;
    line-height: 18px;
    white-space: nowrap;
}

.agent-info-page .bootstrap-table .fixed-table-toolbar {
    margin-bottom: 10px;
}

.agent-info-page .bootstrap-table .table > tbody > tr > td {
    padding-top: 13px;
    padding-bottom: 13px;
    color: var(--az-text);
    vertical-align: middle;
}

.agent-info-page .agent-info-table img,
.agent-info-page .bootstrap-table .table > tbody > tr > td img {
    max-width: 48px;
    max-height: 48px;
    border: 1px solid var(--az-border-soft);
    border-radius: var(--az-radius-sm);
    background: #fff;
    object-fit: contain;
}

.agent-info-page .agent-name-cell {
    min-width: 300px;
    text-align: left;
}

.agent-info-page .agent-name-main {
    margin-bottom: 7px;
    color: var(--az-text);
    font-weight: 700;
}

.agent-info-page .agent-wallet-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 360px;
}

.agent-info-page .agent-wallet-grid span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 21px;
    padding: 1px 6px;
    border: 1px solid #e6edf7;
    border-radius: var(--az-radius-sm);
    background: #fbfdff;
    color: #4d5b70;
    font-size: 12px;
    line-height: 18px;
    white-space: nowrap;
}

.agent-info-page .agent-wallet-grid b {
    color: #64748b;
    font-weight: 650;
}

.agent-info-page .agent-parent-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border: 1px solid #cfefdd;
    border-radius: var(--az-radius-sm);
    background: var(--az-success-soft);
    color: #0f8a4d;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    white-space: nowrap;
}

.agent-info-page .agent-parent-empty {
    color: var(--az-text-muted);
}

.agent-info-page .fixed-table-container td .btn-xs {
    margin: 2px;
}

.agent-info-page .btn-custom-profit,
.agent-info-page .btn-custom-team,
.agent-info-page .btn-custom-detail {
    border-color: var(--az-primary-border);
    background: var(--az-primary-soft);
    color: var(--az-primary);
}

.agent-info-page .btn-custom-detail {
    border-color: #ffe3ad;
    background: var(--az-warning-soft);
    color: var(--az-warning);
}

/* Labels and status chips */
.label,
.badge,
.tag_label_blue,
.tag_label_green,
.tag_label_red,
.tag_label_yellow,
.aftersale_tag {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 7px;
    border: 1px solid transparent;
    border-radius: var(--az-radius-sm);
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
}

.tag_label_blue,
.label-primary {
    border-color: #d8e8ff;
    background: var(--az-primary-soft);
    color: var(--az-primary);
}

.tag_label_green,
.label-success {
    border-color: #d3f0df;
    background: var(--az-success-soft);
    color: var(--az-success);
}

.tag_label_red,
.label-danger,
.aftersale_tag_red {
    border-color: #ffd6d9;
    background: var(--az-danger-soft);
    color: var(--az-danger);
}

.tag_label_yellow,
.label-warning {
    border-color: #ffe3ad;
    background: var(--az-warning-soft);
    color: var(--az-warning);
}

/* Dialogs */
.layui-layer.layui-layer-iframe,
.layui-layer.layui-layer-page {
    border-radius: var(--az-radius) !important;
    overflow: hidden !important;
    box-shadow: 0 18px 46px rgba(15, 23, 42, .16) !important;
}

.layui-layer.layui-layer-iframe .layui-layer-title,
.layui-layer.layui-layer-page .layui-layer-title {
    height: 48px;
    border-bottom: 1px solid var(--az-border-soft);
    background: #fff;
    color: var(--az-text);
    font-size: 15px;
    font-weight: 700;
    line-height: 48px;
}

.layui-layer.layui-layer-iframe .layui-layer-content,
.layui-layer.layui-layer-page .layui-layer-content {
    background: #fff;
}

body.is-dialog .content form.form-horizontal {
    background: #fff;
}

body.is-dialog .content form.form-horizontal .control-label {
    color: #475569;
    font-size: 13px;
    font-weight: 600;
}

body.is-dialog .content form.form-horizontal .layer-footer .btn {
    min-width: 82px;
    height: 34px;
    border-radius: 7px;
}

body.is-dialog .content .banner-form .banner-form-head {
    display: none !important;
}

body.is-dialog .content .banner-form .banner-form-body {
    padding-top: 18px;
}

/* Trees */
#treeview,
.jstree {
    max-width: 100%;
}

body.is-dialog #treeview,
body.is-dialog .jstree {
    min-height: 120px;
    padding: 10px 12px;
    border: 1px solid var(--az-border-soft);
    border-radius: var(--az-radius);
    background: #fbfdff;
    overflow: auto;
}

.jstree-default .jstree-anchor {
    min-height: 26px;
    border-radius: var(--az-radius-sm);
    color: #344256;
    line-height: 26px;
}

.jstree-default .jstree-hovered,
.jstree-default .jstree-clicked {
    background: var(--az-primary-soft);
    box-shadow: none;
    color: var(--az-primary);
}

/* Category editor */
.category-editor-form .goods-editor-section {
    max-width: 1120px;
    margin: 0 auto;
}

.category-editor-form .category-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    margin-bottom: 18px;
}

.category-editor-form .category-editor-grid .form-group {
    margin-bottom: 0;
}

.category-editor-form .category-editor-grid .control-label {
    float: none;
    width: 100%;
    padding: 0 0 7px;
    text-align: left;
}

.category-editor-form .category-editor-grid .col-xs-12.col-sm-8 {
    float: none;
    width: 100%;
    padding: 0;
}

.category-editor-form .bootstrap-select > .btn,
.category-editor-form .form-control {
    border-radius: var(--az-radius);
}

/* Dialog trees, such as king-kong category relation */
body.is-dialog #treeview {
    min-height: 220px;
    padding: 12px 14px;
    border-color: var(--az-border-soft);
    border-radius: var(--az-radius);
    background: #fff;
}

body.is-dialog #treeview .jstree-container-ul {
    min-width: 0;
}

body.is-dialog #treeview .jstree-node {
    color: #344256;
}

body.is-dialog #treeview .jstree-ocl {
    opacity: .55;
}

body.is-dialog #treeview .jstree-leaf {
    min-width: 108px;
    margin: 2px 8px 2px 0;
    padding-left: 22px;
}

body.is-dialog #treeview .jstree-anchor {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 2px 8px 2px 4px;
    border-radius: var(--az-radius-sm);
    line-height: 24px;
}

body.is-dialog #treeview .jstree-checkbox {
    position: relative;
    width: 16px !important;
    height: 16px !important;
    margin: 4px 7px 0 0 !important;
    border: 1px solid #d5e0ee;
    border-radius: 4px;
    background: #fff !important;
    box-shadow: inset 0 1px 1px rgba(18, 32, 53, .04);
    box-sizing: border-box;
}

body.is-dialog #treeview .jstree-anchor.jstree-checked,
body.is-dialog #treeview .jstree-checked > .jstree-anchor,
body.is-dialog #treeview .jstree-clicked {
    background: var(--az-primary-soft);
    color: var(--az-primary);
    font-weight: 600;
}

body.is-dialog #treeview .jstree-anchor.jstree-checked > .jstree-checkbox,
body.is-dialog #treeview .jstree-checked > .jstree-anchor .jstree-checkbox {
    border-color: var(--az-primary);
    background: var(--az-primary) !important;
}

body.is-dialog #treeview .jstree-anchor .jstree-checkbox:after {
    position: absolute;
    top: 1px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    content: "";
    opacity: 0;
    transform: rotate(45deg);
}

body.is-dialog #treeview .jstree-anchor.jstree-checked > .jstree-checkbox:after,
body.is-dialog #treeview .jstree-checked > .jstree-anchor .jstree-checkbox:after {
    opacity: 1;
}

body.is-dialog #treeview .jstree-anchor > .jstree-undetermined,
body.is-dialog #treeview .jstree-undetermined > .jstree-anchor .jstree-checkbox {
    border-color: var(--az-primary);
    background: var(--az-primary-soft) !important;
}

body.is-dialog #treeview .jstree-anchor > .jstree-undetermined:before,
body.is-dialog #treeview .jstree-undetermined > .jstree-anchor .jstree-checkbox:before {
    content: "";
    position: absolute;
    left: 3px;
    top: 6px;
    width: 8px;
    height: 2px;
    border-radius: 2px;
    background: var(--az-primary);
}

/* Config center */
.config-editor-panel {
    overflow: hidden;
    border: 1px solid var(--az-border-soft);
    border-radius: var(--az-radius);
    background: #fff;
    box-shadow: var(--az-shadow-sm);
}

.config-editor-panel > .panel-heading {
    padding: 0;
    border-bottom: 1px solid var(--az-border-soft);
    background: #fff;
}

.config-editor-panel > .panel-heading .nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 12px 16px 0;
    border: 0;
}

.config-editor-panel > .panel-heading .nav-tabs > li {
    margin: 0;
}

.config-editor-panel > .panel-heading .nav-tabs > li > a {
    margin: 0;
    padding: 8px 12px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--az-text-sub);
    font-weight: 600;
}

.config-editor-panel > .panel-heading .nav-tabs > li.active > a,
.config-editor-panel > .panel-heading .nav-tabs > li > a:hover,
.config-editor-panel > .panel-heading .nav-tabs > li > a:focus {
    border: 0;
    border-bottom: 2px solid var(--az-primary);
    background: transparent;
    color: var(--az-primary);
}

.config-editor-panel > .panel-body {
    padding: 0 16px 16px;
    background: #fff;
}

.config-editor-panel .config-table {
    margin-bottom: 0;
}

.config-editor-panel .config-table > thead > tr > th {
    padding: 12px 10px;
    border-bottom: 1px solid var(--az-border-soft);
    background: #f8fbff;
    color: var(--az-text);
    font-weight: 700;
}

.config-editor-panel .config-table > tbody > tr > td {
    padding: 13px 10px;
    border-top: 1px solid #eef3f8;
    background: #fff;
    vertical-align: top;
}

.config-editor-panel .config-table > tbody > tr:hover > td {
    background: #fbfdff;
}

.config-editor-panel .config-table .form-control,
.config-editor-panel .config-table .bootstrap-select > .btn {
    max-width: 760px;
}

.config-editor-panel .config-table small {
    display: block;
    margin-top: 6px;
    color: var(--az-text-muted) !important;
    font-size: 12px !important;
    line-height: 18px;
}

/* Rich text editors */
.ke-container,
.note-editor.note-frame,
.note-editor.panel,
.edui-default .edui-editor {
    border: 1px solid var(--az-border-soft) !important;
    border-radius: var(--az-radius) !important;
    background: #fff !important;
    box-shadow: none !important;
    overflow: hidden;
}

.ke-toolbar,
.note-editor .note-toolbar,
.edui-default .edui-editor-toolbarbox,
.edui-default .edui-editor-toolbarboxouter {
    padding: 8px !important;
    border-bottom: 1px solid var(--az-border-soft) !important;
    background: #f8fbff !important;
    box-shadow: none !important;
}

.ke-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.ke-toolbar .ke-outline,
.note-editor .note-btn,
.edui-default .edui-button .edui-button-wrap,
.edui-default .edui-splitbutton .edui-splitbutton-body {
    min-width: 26px;
    min-height: 26px;
    margin: 1px;
    border: 1px solid transparent !important;
    border-radius: var(--az-radius-sm) !important;
    background: transparent !important;
    box-shadow: none !important;
    transition: border-color .2s ease, background-color .2s ease;
}

.ke-toolbar .ke-outline:hover,
.ke-toolbar .ke-selected,
.note-editor .note-btn:hover,
.note-editor .note-btn:focus,
.edui-default .edui-button .edui-button-wrap:hover,
.edui-default .edui-splitbutton .edui-splitbutton-body:hover,
.edui-default .edui-state-hover .edui-button-wrap,
.edui-default .edui-state-hover .edui-splitbutton-body {
    border-color: var(--az-primary-border) !important;
    background: var(--az-primary-soft) !important;
}

.ke-toolbar .ke-disabled {
    opacity: .45;
}

.ke-edit,
.note-editor .note-editing-area,
.edui-default .edui-editor-iframeholder {
    background: #fff !important;
}

.ke-edit-iframe,
.ke-edit-textarea,
.note-editor .note-editable {
    min-height: 220px;
    padding: 12px !important;
    background: #fff !important;
    color: var(--az-text) !important;
    font-size: 14px;
    line-height: 1.8;
}

.ke-statusbar,
.note-editor .note-statusbar,
.edui-default .edui-editor-bottomContainer td {
    border-top: 1px solid var(--az-border-soft) !important;
    background: #fbfdff !important;
    color: var(--az-text-muted) !important;
}

.ke-menu,
.ke-colorpicker,
.note-editor .dropdown-menu,
.edui-default .edui-popup-content {
    border: 1px solid var(--az-border-soft) !important;
    border-radius: var(--az-radius) !important;
    background: #fff !important;
    box-shadow: var(--az-shadow-md) !important;
    overflow: hidden;
}

/* Right-side detail drawers/pages */
.az-detail-shell,
.order-detail-shell,
.merchant-detail-shell,
.look-detail-shell {
    color: var(--az-text);
}

.az-detail-card,
.order-detail-card,
.merchant-detail-card,
.look-detail-card {
    border: 1px solid var(--az-border-soft);
    border-radius: var(--az-radius);
    background: #fff;
    box-shadow: var(--az-shadow-sm);
}

.az-detail-section,
.order-detail-section,
.merchant-detail-section,
.look-detail-section {
    border: 1px solid var(--az-border-soft);
    border-radius: var(--az-radius);
    background: #fff;
}

.az-section-title,
.order-detail-title,
.merchant-detail-title,
.look-detail-title {
    display: flex;
    align-items: center;
    color: var(--az-text);
    font-weight: 700;
}

.az-section-title::before,
.order-detail-title::before,
.merchant-detail-title::before,
.look-detail-title::before {
    content: "";
    width: 3px;
    height: 18px;
    margin-right: 10px;
    border-radius: 3px;
    background: var(--az-primary);
}

@media (max-width: 767px) {
    .content {
        padding: 12px;
    }

    .btn:not(.btn-xs):not(.btn-sm):not(.btn-lg) {
        min-height: 31px;
        padding: 5px 10px;
    }

    .radio {
        gap: 7px;
    }

    .radio > label {
        min-height: 30px;
        padding: 4px 11px 4px 30px;
        font-size: 12px;
    }

    .category-editor-form .category-editor-grid {
        grid-template-columns: 1fr;
    }

    .config-editor-panel > .panel-heading .nav-tabs {
        padding-right: 10px;
        padding-left: 10px;
    }

    .config-editor-panel > .panel-body {
        padding: 0 10px 12px;
    }
}

@media (max-width: 1400px) {
    .agent-info-page .agent-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .agent-info-page .agent-stat-grid {
        grid-template-columns: 1fr;
    }
}
