.login-page { background: #eef1f5; }
.login-logo { font-weight: 300; }
.brand-link { min-height: 57px; }

.dashboard-card {
    min-height: 205px;
    border-left-width: 4px;
    border-left-style: solid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.dashboard-card-title {
    color: #5f6670;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 22px;
}

.dashboard-main-value {
    color: #252a30;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.dashboard-card-meta {
    color: #7b8188;
    margin-top: 14px;
}

.coin-summary-row {
    align-items: center;
    border-bottom: 1px solid #edf0f2;
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
}

.coin-summary-row:last-child {
    border-bottom: 0;
}

.coin-summary-row span {
    color: #7b8188;
    font-size: 0.82rem;
    font-weight: 700;
}

.coin-summary-row strong {
    color: #252a30;
    font-size: 1rem;
    overflow-wrap: anywhere;
    text-align: right;
}

.border-left-primary { border-left-color: #007bff !important; }
.border-left-success { border-left-color: #28a745 !important; }
.border-left-info { border-left-color: #17a2b8 !important; }
.border-left-purple { border-left-color: #6f42c1 !important; }
.border-left-warning { border-left-color: #ffc107 !important; }
.border-left-dark { border-left-color: #343a40 !important; }
.border-left-danger { border-left-color: #dc3545 !important; }

.customer-summary-row > [class*="col-"] { min-width: 210px; }
.customer-summary-card { min-height: 132px; }
.customer-summary-card .dashboard-card-title { margin-bottom: 16px; }
.customer-summary-card .dashboard-main-value small { color: #7b8188; font-size: .9rem; margin-left: 4px; }
.customer-search-form { display: grid; grid-template-columns: 160px 110px minmax(220px, 360px) auto auto; gap: 8px; max-width: 1100px; }
.position-search-form { display: grid; grid-template-columns: 160px 110px minmax(220px, 360px) auto; gap: 8px; max-width: 1000px; }
.search-type-select { min-width: 0; }
.search-keyword-input { min-width: 0; }
.customer-table { min-width: 1380px; }
.customer-table th { background: #f5f6f8; border-top: 0; font-size: .85rem; white-space: nowrap; }
.customer-table td { font-size: .88rem; vertical-align: middle; }
.coin-cell { min-width: 180px; }
.coin-cell span { display: flex; justify-content: space-between; gap: 10px; line-height: 1.6; }
.coin-cell b { color: #7b8188; font-size: .75rem; }
.coin-cell em { font-style: normal; white-space: nowrap; }
.detail-grid > div { border-bottom: 1px solid #edf0f2; display: grid; grid-template-columns: 130px 1fr; gap: 20px; padding: 13px 0; }
.detail-grid > div:last-child { border-bottom: 0; }
.detail-grid span { color: #7b8188; font-weight: 600; }
.detail-grid strong { overflow-wrap: anywhere; }
@media (max-width: 767px) { .customer-search-form, .position-search-form { grid-template-columns: 1fr; } .customer-search-form .btn, .position-search-form .btn { width: 100%; } }

/* Customer summary cards */
.customer-summary-card,
.customer-detail-summary-card {
    height: 132px;
    min-height: 132px;
}
.customer-summary-card .card-body,
.customer-detail-summary-card .card-body {
    padding: 1rem 1.1rem;
}
.customer-summary-card .dashboard-card-title,
.customer-detail-summary-card .dashboard-card-title {
    margin-bottom: 12px;
}
.compact-coin-summary {
    display: grid;
    gap: 3px;
}
.compact-coin-summary span {
    align-items: center;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 6px;
    line-height: 1.15;
}
.compact-coin-summary b {
    color: #7b8188;
    font-size: .7rem;
    font-weight: 800;
}
.compact-coin-summary em {
    color: #252a30;
    font-size: .84rem;
    font-style: normal;
    font-weight: 700;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Customer detail */
.customer-profile-card { border-top: 3px solid #007bff; }
.customer-avatar {
    align-items: center;
    background: #eaf2ff;
    border-radius: 50%;
    color: #007bff;
    display: flex;
    font-size: 1.6rem;
    height: 64px;
    justify-content: center;
    margin-right: 16px;
    width: 64px;
}
.customer-detail-summary-row > [class*="col-"] { min-width: 210px; }
.customer-detail-summary-card .dashboard-main-value { font-size: 1.55rem; }
.customer-detail-summary-card .dashboard-main-value small { color: #7b8188; font-size: .85rem; margin-left: 4px; }
.badge-lg { font-size: .78rem; padding: .42em .65em; }
.referrer-panel { align-items: center; display: flex; gap: 14px; min-height: 150px; }
.referrer-icon {
    align-items: center;
    background: #f0f3f6;
    border-radius: 50%;
    color: #59636e;
    display: flex;
    flex: 0 0 52px;
    font-size: 1.25rem;
    height: 52px;
    justify-content: center;
}
.empty-detail-state { color: #9aa0a6; padding: 42px 10px; text-align: center; }
.empty-detail-state i { font-size: 2rem; margin-bottom: 12px; }
.empty-detail-state p { margin: 0; }
@media (max-width: 575px) {
    .customer-summary-card,
    .customer-detail-summary-card { height: auto; min-height: 124px; }
    .referrer-panel { align-items: flex-start; flex-wrap: wrap; }
}

/* Position list */
.position-summary-card { min-height: 118px; }
.position-summary-card .card-body { padding: 1rem; }
.position-summary-card .dashboard-main-value { font-size: 1.55rem; margin-top: .7rem; white-space: nowrap; }
.position-summary-card .dashboard-main-value small { font-size: .75rem; margin-left: .2rem; }
.position-margin-summary { margin-top: .5rem; line-height: 1.15; }
.position-margin-summary strong { display: block; font-size: 1.25rem; overflow: hidden; text-overflow: ellipsis; }
.position-margin-summary small { display: block; margin-top: .25rem; color: #6c757d; overflow: hidden; text-overflow: ellipsis; }
.position-live-value { font-size: 1.25rem !important; }
.position-table { min-width: 1700px; }
.position-table th { white-space: nowrap; text-align: center; vertical-align: middle; }
.position-table td { white-space: nowrap; text-align: center; vertical-align: middle; }
.position-table .live-pl { min-width: 125px; }
@media (max-width: 767.98px) {
    .position-summary-card { min-height: 105px; }
    .position-summary-card .dashboard-main-value { font-size: 1.25rem; }
    .position-margin-summary strong { font-size: 1.05rem; }
}

/* Commission settlement */
.commission-summary-card { min-height: 108px; }
.commission-summary-card .card-body { padding: 1rem; }
.commission-summary-card .dashboard-main-value { font-size: 1.25rem; margin-top: .65rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commission-search-form { align-items: center; display: flex; flex-wrap: wrap; gap: .45rem; }
.commission-search-form input[type="date"] { max-width: 155px; }
.commission-search-form select { max-width: 105px; }
.commission-search-form input[name="keyword"] { max-width: 220px; }
.commission-table { min-width: 1250px; }
.referral-table { min-width: 1500px; }
.commission-table th, .commission-table td { text-align: center; vertical-align: middle; white-space: nowrap; }
.tree-toggle { color: #6c757d; display: inline-block; font-size: .7rem; margin-right: .35rem; }
@media (max-width: 767.98px) {
    .commission-summary-card { min-height: 96px; }
    .commission-summary-card .dashboard-main-value { font-size: 1.05rem; }
    .commission-search-form input[type="date"], .commission-search-form select, .commission-search-form input[name="keyword"] { max-width: none; width: 100%; }
}

/* Customer detail transaction/position tabs */
.customer-top-info-row .card { margin-bottom: 0; }
.customer-top-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.customer-data-tabs-card .nav-tabs .nav-link { font-weight: 700; padding: .9rem 1.4rem; }
.customer-trade-search-form { align-items: center; display: flex; flex-wrap: wrap; gap: .45rem; }
.customer-trade-search-form input[type="date"] { max-width: 155px; }
.customer-trade-search-form .search-type-select { max-width: 105px; }
.customer-trade-search-form .search-keyword-input { min-width: 220px; max-width: 320px; }
.customer-trade-search-form .date-separator { color: #6c757d; font-weight: 700; }
.customer-trade-table { min-width: 1450px; }
.customer-position-table { min-width: 1200px; }
.customer-trade-table th, .customer-trade-table td,
.customer-position-table th, .customer-position-table td { text-align: center; vertical-align: middle; white-space: nowrap; }
@media (max-width: 767.98px) {
    .customer-top-detail-grid { grid-template-columns: 1fr; }
    .customer-trade-search-form { align-items: stretch; flex-direction: column; }
    .customer-trade-search-form input[type="date"], .customer-trade-search-form .search-type-select,
    .customer-trade-search-form .search-keyword-input, .customer-trade-search-form .btn { max-width: none; width: 100%; }
    .customer-trade-search-form .date-separator { display: none; }
    .customer-trade-search-form .date-preset-group { display: flex; width: 100%; }
    .customer-trade-search-form .date-preset-group .btn { flex: 1; }
}
.customer-profile-inline{display:flex;align-items:center;gap:1.25rem}.customer-avatar-large{width:72px;height:72px;min-width:72px;font-size:1.8rem}.customer-profile-fields{display:grid;grid-template-columns:repeat(3,minmax(160px,1fr));gap:.65rem 1.25rem;flex:1}.customer-profile-fields div{display:flex;flex-direction:column}.customer-profile-fields span,.customer-referrer-inline span{font-size:.78rem;color:#6c757d}.customer-profile-fields strong{font-size:.95rem;word-break:break-all}.customer-referrer-inline{min-width:170px;padding-left:1.25rem;border-left:1px solid #e5e7eb;display:flex;flex-direction:column}.date-preset-group .btn.active{box-shadow:inset 0 0 0 1px rgba(255,255,255,.35);font-weight:700}.position-search-form{display:flex;align-items:center;gap:.45rem;flex-wrap:wrap}.position-search-form .search-type-select{max-width:105px}.position-search-form .search-keyword-input{min-width:220px;max-width:320px}
@media(max-width:767.98px){.customer-profile-inline{align-items:flex-start;flex-wrap:wrap}.customer-profile-fields{grid-template-columns:1fr 1fr;width:calc(100% - 95px)}.customer-referrer-inline{width:100%;border-left:0;border-top:1px solid #e5e7eb;padding:1rem 0 0}.position-search-form .search-type-select,.position-search-form .search-keyword-input,.position-search-form .btn{max-width:none;width:100%}}

/* UID memo */
.uid-memo-btn{border:0;background:transparent;color:#6c757d;padding:0 4px 0 0;font-size:12px;line-height:1;vertical-align:middle;cursor:pointer}
.uid-memo-btn:hover{color:#007bff}.uid-memo-btn-xs{font-size:10px;padding-right:3px}.uid-memo-list{max-height:390px;overflow-y:auto}
.uid-memo-item{border:1px solid #e4e7eb;border-radius:6px;padding:12px;margin-bottom:10px;background:#fff}.uid-memo-meta{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;color:#6c757d;font-size:12px;border-bottom:1px solid #f0f1f3;padding-bottom:7px;margin-bottom:8px}.uid-memo-content{white-space:normal;word-break:break-word;font-size:14px}.uid-memo-editor textarea{resize:vertical}.uid-memo-item .btn-xs{padding:.125rem .35rem;font-size:.72rem}

/* UID memo popup v3.6.1 */
.uid-memo-modal-content{max-height:90vh}
.uid-memo-modal-body{display:flex;flex-direction:column;overflow:hidden;padding:0}
.uid-memo-fixed-area{flex:0 0 auto;padding:1rem;border-bottom:1px solid #e9ecef;background:#fff;position:relative;z-index:2}
.uid-memo-list-area{display:flex;flex-direction:column;min-height:0;overflow:hidden;padding:1rem 1rem .75rem}
.uid-memo-list{flex:1 1 auto;max-height:none;min-height:230px;overflow-y:auto;padding-right:2px}
.uid-memo-pagination{flex:0 0 auto;display:flex;justify-content:center;gap:4px;padding-top:8px}
.uid-memo-pagination .btn{min-width:32px}
.uid-memo-editor textarea{resize:none}
@media (max-width:575.98px){.uid-memo-modal-content{max-height:94vh}.uid-memo-list{min-height:190px}.uid-memo-fixed-area,.uid-memo-list-area{padding:.75rem}}
.uid-latest-memo{display:block;color:#000;font-size:inherit;font-weight:400;line-height:1.25;margin-top:4px;white-space:normal;word-break:break-word;max-width:280px}
.customer-status-lines span{display:block;white-space:nowrap}.customer-status-lines .gift-amount{color:#555}.customer-detail-summary-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:12px;margin-bottom:16px}.customer-detail-summary-grid .card{margin-bottom:0}.customer-detail-summary-grid .card-body{padding:10px 8px;text-align:left}.customer-detail-summary-grid .card-body b{display:block;font-size:13px;margin-bottom:6px}.summary-lines span{font-size:12px}.summary-lines span{display:block;line-height:1.45}.customer-five-tabs .nav-link{font-weight:600}.wallet-note span{display:block}
@media(max-width:1400px){.customer-detail-summary-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(max-width:767px){.customer-detail-summary-grid{grid-template-columns:1fr}.customer-detail-search-form{display:flex;flex-wrap:wrap;gap:6px}.customer-detail-search-form .form-control{width:auto;flex:1 1 140px}}


/* v3.7.1 customer detail UI restoration */
.customer-data-tabs-card,
.customer-detail-summary-grid,
.customer-detail-summary-grid .card,
.customer-detail-summary-grid .card-body,
.customer-data-tabs-card .card-body,
.customer-data-tabs-card table,
.customer-data-tabs-card input,
.customer-data-tabs-card select,
.customer-data-tabs-card button {
    font-family: inherit;
}

.customer-detail-summary-grid .card {
    border-left: 4px solid #007bff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    min-height: 126px;
}
.customer-detail-summary-grid .card:nth-child(2) { border-left-color: #ffc107; }
.customer-detail-summary-grid .card:nth-child(3) { border-left-color: #343a40; }
.customer-detail-summary-grid .card:nth-child(4) { border-left-color: #17a2b8; }
.customer-detail-summary-grid .card:nth-child(5) { border-left-color: #6f42c1; }
.customer-detail-summary-grid .card:nth-child(6) { border-left-color: #28a745; }
.customer-detail-summary-grid .card-body { padding: 1rem 1.1rem; }
.customer-detail-summary-grid .card-body > b {
    color: #5f6670;
    display: block;
    font-size: .95rem;
    font-weight: 700;
    margin-bottom: 12px;
}
.customer-detail-summary-grid .summary-lines span {
    color: #252a30;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.customer-data-tabs-card .card-header {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
}
.customer-data-tabs-card .nav-tabs { border-bottom: 0; }
.customer-data-tabs-card .nav-tabs .nav-link {
    background: transparent;
    border-color: transparent;
    color: #212529 !important;
    font-size: .95rem;
    font-weight: 700;
    padding: .9rem 1.4rem;
}
.customer-data-tabs-card .nav-tabs .nav-link:hover {
    color: #007bff !important;
}
.customer-data-tabs-card .nav-tabs .nav-link.active {
    background: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
    color: #007bff !important;
}

.customer-detail-search-form {
    align-items: center;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: .45rem;
    min-width: 920px;
    overflow: visible;
    position: relative;
    z-index: 3;
}
.customer-detail-search-form .date-preset-group {
    display: inline-flex;
    flex: 0 0 auto;
    position: relative;
    z-index: 4;
}
.customer-detail-search-form .date-preset-group .btn {
    pointer-events: auto;
    position: relative;
    white-space: nowrap;
    z-index: 5;
}
.customer-detail-search-form .date-preset-group .btn.active,
.customer-detail-search-form .date-preset-group .btn.btn-primary {
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: #fff !important;
}
.customer-detail-search-form input[type="date"] {
    flex: 0 0 150px;
    max-width: 150px;
    min-width: 150px;
}
.customer-detail-search-form > span { color: #6c757d; flex: 0 0 auto; font-weight: 700; }
.customer-detail-search-form select {
    flex: 0 0 105px;
    max-width: 105px;
    min-width: 105px;
}
.customer-detail-search-form input:not([type="hidden"]):not([type="date"]) {
    flex: 1 1 auto;
    min-width: 220px;
}
.customer-detail-search-form > .btn-primary {
    flex: 0 0 auto;
    min-width: 68px;
    white-space: nowrap;
}
.customer-data-tabs-card .tab-pane { overflow-x: auto; }

.customer-data-tabs-card table thead th,
.customer-detail-table thead th {
    background: #f5f6f8 !important;
    border-bottom: 2px solid #dee2e6;
    color: #343a40;
    font-size: .85rem;
    font-weight: 700;
    padding: .65rem .5rem;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}
.customer-data-tabs-card table tbody td,
.customer-detail-table tbody td {
    color: #212529;
    font-size: .88rem;
    padding: .55rem .5rem;
    vertical-align: middle;
}
.customer-data-tabs-card table.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, .045);
}

.customer-total-asset-summary { display: grid; gap: 6px; }
.customer-total-asset-summary span {
    color: #252a30;
    display: block;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.customer-total-asset-summary .gift-amount { color: #555; font-size: .88rem; }

@media (max-width: 991.98px) {
    .customer-data-tabs-card .card-body { overflow-x: auto; }
    .customer-detail-search-form { min-width: 920px; }
}


/* v3.8 detail search result summaries */
.detail-result-summary{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 12px;padding:12px;background:#f8f9fb;border:1px solid #e2e6ea;border-radius:6px}
.detail-result-summary span{display:flex;align-items:center;gap:10px;min-width:190px;padding:8px 12px;background:#fff;border-left:3px solid #007bff;border-radius:4px;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.detail-result-summary b{color:#6c757d;font-size:.82rem}.detail-result-summary em{margin-left:auto;color:#212529;font-style:normal;font-weight:700}
.customer-detail-search-form input:not([type="hidden"]):not([type="date"]){flex:0 1 210px!important;max-width:210px!important;min-width:180px!important}
.customer-detail-search-form select{flex-basis:105px}.customer-detail-table th,.customer-detail-table td{text-align:center!important;vertical-align:middle!important}
@media(max-width:767.98px){.detail-result-summary span{min-width:100%;}.customer-detail-search-form input:not([type="hidden"]):not([type="date"]){max-width:none!important;width:100%!important}}

/* Dashboard v3.8.7 layout */
.dashboard-fixed-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.dashboard-fixed-row .dashboard-card,
.dashboard-search-results .dashboard-card {
    margin-bottom: 0;
}
.dashboard-compact-card {
    min-height: 150px;
}
.dashboard-compact-card .card-body,
.dashboard-search-card .card-body {
    padding: 1rem 1.1rem;
}
.dashboard-compact-card .dashboard-card-title,
.dashboard-search-card .dashboard-card-title {
    margin-bottom: 12px;
}
.dashboard-date-search-card {
    border-top: 3px solid #007bff;
}
.dashboard-search-results {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .8rem;
}
.dashboard-search-card {
    min-height: 170px;
}
.dashboard-search-card .dashboard-main-value {
    font-size: 1.42rem;
}
.dashboard-search-card .coin-summary-row {
    padding: 7px 0;
}
.dashboard-search-card .coin-summary-row strong {
    font-size: .9rem;
}
@media (max-width: 1599.98px) {
    .dashboard-search-results { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
    .dashboard-fixed-row { grid-template-columns: 1fr; }
    .dashboard-search-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
    .dashboard-search-results { grid-template-columns: 1fr; }
}

/* Commission search result summary */
.commission-search-summary{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
.commission-search-summary span{min-width:0;margin:0}
@media(max-width:1199.98px){.commission-search-summary{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:767.98px){.commission-search-summary{grid-template-columns:1fr}}


/* Commission top summary: fill the full row evenly by item count */
.commission-summary-row {
    display: flex;
    flex-wrap: wrap;
}
.commission-summary-row > [class*="col-"] {
    flex: 1 1 0;
    width: auto;
    max-width: none;
    min-width: 180px;
}
@media (max-width: 767.98px) {
    .commission-summary-row > [class*="col-"] {
        flex: 1 1 50%;
        max-width: 50%;
    }
}
@media (max-width: 575.98px) {
    .commission-summary-row > [class*="col-"] {
        flex-basis: 100%;
        max-width: 100%;
    }
}

/* v3.8.15 invite/referral management */
.invite-code-table th,.invite-code-table td,.referral-management-table th,.referral-management-table td{vertical-align:middle;text-align:center;}
.invite-code-card .card-header{background:#fff;}
.invite-help{border-top:1px solid #e5e7eb;margin-top:20px;padding-top:14px;font-size:13px;color:#555;line-height:1.7;}
.invite-help strong{display:block;margin-bottom:8px;color:#444;}
.btn-xs{padding:.15rem .35rem;font-size:.75rem;line-height:1.3;border-radius:.2rem;}
.referral-management-table thead th,.invite-code-table thead th{background:#343a40;color:#fff;font-weight:600;border-color:#5a6268;}
@media(max-width:991.98px){.invite-code-table,.referral-management-table{min-width:1000px;}}

/* v3.8.35 customer asset table */
.customer-asset-table th,
.customer-asset-table td {
    text-align: center;
    vertical-align: middle;
}


/* v3.8.36 referral summary typography alignment */
.referral-coin-summary span {
    grid-template-columns: 40px minmax(0, 1fr);
}
.referral-asset-summary span {
    grid-template-columns: 72px minmax(0, 1fr);
}
