* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background: #f0f2f5; color: #333; font-size: 14px; }
a { text-decoration: none; color: inherit; }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); }
.login-box { background: #fff; padding: 36px 40px 32px; border-radius: 12px; width: 400px; box-shadow: 0 8px 32px rgba(0,0,0,.2); }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-brand img { display: block; }
.login-brand h1 { margin: 0; font-size: 24px; font-weight: 700; color: #008c5e; line-height: 1.2; }
.login-subtitle { text-align: center; color: #888; font-size: 13px; margin: 0 0 22px; }
.login-box .btn { justify-content: center; }
.login-submit { width: 100%; padding: 12px; margin-top: 4px; font-size: 14px; }
.login-captcha-row { display: flex; align-items: center; gap: 10px; }
.login-captcha-row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 0.08em; font-size: 14px; }
.login-captcha-img { flex: 0 0 auto; border: 1px solid #d7e3dc; border-radius: 8px; cursor: pointer; background: #f5f8f6; }
.login-box .form-group label { font-size: 13px; color: #555; }
.login-box .form-group input { font-size: 14px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #008c5e; }
.error-msg { background: #fee; color: #c00; padding: 10px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
@media (max-width: 768px) {
    .login-page {
        align-items: flex-start;
        padding: 16px;
        padding-top: max(24px, env(safe-area-inset-top, 0px));
        padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    }
    .login-box {
        width: 100%;
        max-width: 420px;
        padding: 24px 18px 20px;
        border-radius: 10px;
    }
    .login-brand h1 { font-size: 22px; }
    .login-subtitle { margin-bottom: 18px; }
    .login-box .form-group input { font-size: 16px; }
    .login-captcha-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .login-captcha-row input { width: 100%; }
    .login-captcha-img {
        width: 100%;
        max-width: 220px;
        height: auto;
        align-self: center;
    }
    .login-submit { padding: 13px 12px; font-size: 16px; }
}

/* Layout */
.admin-layout { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: #1a1a2e; color: #fff; padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; position: fixed; top: 0; left: 0; right: 0; z-index: 100; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: #fff; }
.logo img { display: block; flex-shrink: 0; border-radius: 6px; }
.logo-text { line-height: 1; letter-spacing: 0.02em; }
.shop-badge { background: #008c5e; padding: 4px 12px; border-radius: 4px; font-size: 13px; }
.shop-badge--impersonating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #008c5e;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    border: 2px solid #ffd666;
    color: #fff;
    cursor: pointer;
    transition: filter 0.15s, transform 0.15s;
}
.shop-badge-icon { display: inline-flex; flex-shrink: 0; line-height: 0; opacity: 0.95; }
.shop-badge-icon svg { display: block; }
.shop-badge-name { line-height: 1.2; }
.shop-badge-exit { line-height: 1; opacity: 0.9; }
.shop-badge--impersonating:hover { filter: brightness(1.12); transform: translateY(-1px); }
.welcome-impersonating { color: #ffd666; font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.welcome { font-size: 13px; color: #ccc; }
.welcome-status { margin-left: 4px; font-size: 12px; font-weight: 600; }
.welcome-status--trial,
.welcome-status--formal { color: #7dcea0; }
.welcome-status--suspended { color: #ffb74d; }
.main-wrapper { display: flex; margin-top: 56px; min-height: calc(100vh - 56px); }
.sidebar { width: 180px; background: #fff; border-right: 1px solid #e8e8e8; position: fixed; top: 56px; bottom: 0; left: 0; z-index: 30; overflow: hidden; }
.sidebar-nav { height: 100%; box-sizing: border-box; padding: 12px 0 52px; overflow-x: hidden; overflow-y: auto; }
.sidebar-foot {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 8px 16px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    pointer-events: none;
}
.sidebar-version {
    text-align: center;
    font-size: 11px;
    color: #bbb;
    user-select: none;
    line-height: 1.2;
}
.sidebar-nav > .nav-item,
.sidebar-nav > .nav-group > .nav-group-toggle {
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: 0;
}
.sidebar-nav > .nav-item .nav-item-label,
.sidebar-nav > .nav-group > .nav-group-toggle .nav-group-label {
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    letter-spacing: inherit;
}
.sidebar-nav > .nav-item.active,
.sidebar-nav > .nav-group.is-active-group > .nav-group-toggle {
    font-weight: 600;
}
.sidebar-nav > .nav-item .nav-badge,
.sidebar-nav > .nav-group > .nav-group-toggle .nav-badge {
    font-size: inherit;
    line-height: inherit;
}
.nav-item { display: flex; align-items: center; gap: 4px; padding: 12px 24px; color: #555; font-size: 14px; border-left: 3px solid transparent; transition: color .2s, background .2s; }
.nav-item-label { flex: 1; min-width: 0; }
.nav-badge {
    flex-shrink: 0;
    color: #e53935;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    min-width: 0;
    height: auto;
    border-radius: 0;
    animation: none;
}
.nav-badge[hidden] { display: none !important; }
.sidebar-nav > .nav-item[data-has-badge="1"] .nav-item-label,
.sidebar-nav > .nav-group > .nav-group-toggle[data-has-badge="1"] .nav-group-label {
    color: #e53935;
    font-weight: inherit;
}
.nav-item[data-has-badge="1"] .nav-item-label {
    color: #e53935;
}
.nav-item[data-has-badge="1"]:hover .nav-item-label,
.nav-item[data-has-badge="1"]:hover .nav-badge {
    color: #e53935;
}
.nav-item:hover { background: #f5f5f5; color: #008c5e; }
.nav-item.active { background: #f0faf5; color: #008c5e; border-left-color: #008c5e; }
.nav-group { border-bottom: 1px solid #f5f5f5; }
.nav-group-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: 12px 20px 12px 24px; border: none; background: transparent; cursor: pointer;
    color: #555; font-size: 14px; font-family: inherit; font-weight: 400; line-height: 20px; text-align: left;
    appearance: none;
    -webkit-appearance: none;
}
.nav-group-label { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 4px; }
.nav-group-toggle[data-has-badge="1"] .nav-group-label {
    color: #e53935;
}
.nav-group-toggle[data-has-badge="1"]:hover .nav-group-label,
.nav-group-toggle[data-has-badge="1"]:hover .nav-badge {
    color: #e53935;
}
.nav-group-toggle:hover { background: #f5f5f5; color: #008c5e; }
.nav-group.is-active-group > .nav-group-toggle { color: #008c5e; }
.nav-group.is-active-group > .nav-group-toggle[data-has-badge="1"] .nav-group-label {
    color: #e53935;
}
.nav-group-caret {
    width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg); transition: transform .2s; margin-top: -2px; flex-shrink: 0;
}
.nav-group.is-open .nav-group-caret { transform: rotate(-135deg); margin-top: 2px; }
.nav-sub-items { display: none; padding-bottom: 4px; }
.nav-group.is-open .nav-sub-items { display: block; }
.nav-item--sub { padding-left: 40px; font-size: 13px; }
.sidebar--disabled .nav-item,
.sidebar--disabled .nav-group-toggle {
    pointer-events: none;
    opacity: 0.42;
    cursor: not-allowed;
}
.sidebar--disabled .nav-item:hover,
.sidebar--disabled .nav-group-toggle:hover {
    background: transparent;
    color: #555;
}
.sidebar--disabled .nav-item.active {
    background: #f7f7f7;
    color: #888;
    border-left-color: #ddd;
}
.sidebar-disabled-hint {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 52px;
    padding: 8px 12px;
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
    color: #c62828;
    background: #fdecea;
    border-top: 1px solid #f5c6cb;
}
.content { flex: 1; margin-left: 180px; padding: 24px; min-width: 0; position: relative; z-index: 0; }

/* Mobile top nav (orders / 卡单 / PP) */
.mobile-top-nav { display: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 4px; padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-size: 13px; font-weight: 500; transition: all .2s; }
.btn-primary { background: #008c5e; color: #fff; }
.btn-primary:hover { background: #007a52; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-outline { background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.1); }
.btn-topbar-recharge { font-weight: 600; }
.client-topbar-balances {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border-radius: 8px;
    background: rgba(255,255,255,.06);
}
.client-verification-balance {
    font-size: 13px;
    color: rgba(255,255,255,.92);
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,.08);
    white-space: nowrap;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}
.client-verification-balance .balance-key {
    font-size: 12px;
    color: rgba(255,255,255,.72);
    letter-spacing: .02em;
}
.client-verification-balance strong { color: #7dcea0; font-size: 15px; line-height: 1; }
.client-balance-usdt strong { color: #81d4fa; }
.client-verification-balance.is-low strong { color: #ff8a80; }
.recharge-modal-body { padding: 8px 0 4px; line-height: 1.6; }
.recharge-modal-body p { margin: 0 0 12px; }
.recharge-balance-line { font-size: 16px; }

/* Client USDT recharge modal */
.client-recharge-modal {
    width: min(960px, calc(100vw - 24px));
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: #fff;
    border-radius: 12px;
    padding: 0 24px 22px;
    box-shadow: 0 12px 40px rgba(0,0,0,.18);
    font-size: 13px;
    line-height: 1.5;
    color: #333;
}
.client-recharge-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0 12px;
    border-bottom: 1px solid #eef2ef;
    margin-bottom: 12px;
}
.client-recharge-modal .modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}
.client-recharge-balances {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px 8px;
    padding: 10px 12px;
    background: linear-gradient(180deg, #f4fbf6 0%, #eef8f1 100%);
    border: 1px solid #cfe9d6;
    border-radius: 10px;
    margin-bottom: 12px;
}
.client-recharge-balance-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    text-align: center;
}
.client-recharge-balance-item .label {
    color: #7a8b81;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}
.client-recharge-balance-item strong {
    color: #2e7d4a;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}
.client-recharge-price-item strong { color: #1565c0; }
.client-recharge-step-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: #222;
    line-height: 1.35;
}
.client-recharge-type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.client-recharge-type-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 10px;
    border: 1px solid #d8e8dc;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.client-recharge-type-card:hover {
    border-color: #008c5e;
    background: #f7fcf9;
    box-shadow: 0 4px 14px rgba(0, 140, 94, 0.08);
}
.client-recharge-type-card .type-icon { font-size: 18px; line-height: 1; }
.client-recharge-type-card strong { font-size: 13px; font-weight: 600; color: #222; }
.client-recharge-type-card .type-desc { font-size: 11px; color: #888; line-height: 1.4; }
.client-recharge-cost-preview {
    margin: 0 0 12px;
    padding: 9px 12px;
    background: #f5f9f6;
    border: 1px solid #dceee2;
    border-radius: 8px;
    color: #2e7d4a;
    font-size: 13px;
    font-weight: 600;
}
.client-recharge-hint { margin: 0 0 6px; font-size: 12px; line-height: 1.5; }
.client-recharge-hint-blue { color: #1976d2; }
.client-recharge-hint-orange { color: #ef6c00; }
.client-recharge-amount-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #444;
}
.client-recharge-amount-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
}
.client-recharge-amount-row input {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 280px;
    padding: 9px 12px;
    border: 1px solid #d7e3dc;
    border-radius: 8px;
    font-size: 13px;
}
.client-recharge-range-hint { color: #999; font-size: 11px; white-space: nowrap; flex: 0 0 auto; }
.client-recharge-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}
.client-recharge-actions.stacked {
    flex-direction: column;
    gap: 12px;
}
.client-recharge-btn-main,
.client-recharge-btn-outline {
    justify-content: center;
    min-height: 40px;
    font-size: 13px;
    font-weight: 600;
}
.client-recharge-actions.stacked .client-recharge-btn-main,
.client-recharge-actions.stacked .client-recharge-btn-outline {
    width: 100%;
}
.client-recharge-btn-outline {
    background: #fff;
    color: #008c5e;
    border: 1px solid #008c5e;
}
.client-recharge-btn-outline:hover { background: #f3fbf7; }
.client-recharge-success-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e8f5e9;
    color: #2e7d4a;
    border-radius: 8px;
    padding: 9px 12px;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 13px;
}
.client-recharge-order-box {
    border: 1px solid #b8dfc4;
    border-radius: 10px;
    padding: 12px 14px;
    background: #fbfffc;
}
.client-recharge-order-row {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 10px;
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.45;
    min-height: 28px;
}
.client-recharge-order-row:last-child {
    margin-bottom: 0;
}
.client-recharge-order-row .label {
    color: #888;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 500;
}
.client-recharge-order-row .value {
    min-width: 0;
    color: #333;
    font-size: 13px;
    font-weight: 500;
}
.client-recharge-order-row .btn-copy {
    justify-self: end;
}
.client-recharge-order-row.client-recharge-order-row-address {
    align-items: start;
}
.client-recharge-order-row.client-recharge-order-row-address .label {
    padding-top: 6px;
}
.client-recharge-order-row .value.mono {
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
}
.client-recharge-order-row .value.amount { color: #c62828; font-weight: 600; }
.client-recharge-order-row .value.pp-estimate { color: #2e7d4a; font-weight: 600; }
.client-recharge-order-row .value.expires { color: #c62828; font-weight: 500; }
.client-recharge-order-row .value.fingerprint {
    color: #1565c0;
    font-family: Consolas, Monaco, monospace;
    font-weight: 600;
    font-size: 12px;
}
.client-recharge-order-row .value.countdown { color: #ef6c00; font-weight: 600; }
.client-recharge-order-row#clientRechargeCountdownRow.is-expired .value.countdown { color: #c62828; }
.client-recharge-order-row code.address-value {
    display: block;
    white-space: normal;
    word-break: break-all;
    overflow: visible;
    background: #f3f4f6;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.45;
    margin: 0;
    border: none;
    font-family: Consolas, Monaco, monospace;
    font-weight: 500;
}
.client-recharge-order-row code.address-value .addr-part { color: #c62828; font-weight: 600; }
.btn-copy {
    border: none;
    background: #eef4fb;
    color: #1565c0;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.3;
}
.btn-copy:hover { background: #bbdefb; }
.client-recharge-countdown strong { font-size: 14px; color: #ef6c00; }
.client-recharge-countdown.is-expired { background: #fdecea; color: #c62828; }
.client-recharge-countdown.is-expired strong { color: #c62828; }
.client-recharge-qr-wrap {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #dceee2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.client-recharge-qr-wrap img {
    width: 168px;
    height: 168px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fff;
    padding: 6px;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}
.client-recharge-qr-wrap .qr-hint { font-size: 11px; color: #999; margin: 0; line-height: 1.45; max-width: 100%; }
.client-recharge-warning {
    margin-top: 12px;
    padding: 10px 12px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    color: #8d6e00;
    font-size: 12px;
    line-height: 1.55;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.client-recharge-warning .warn-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffb300;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.client-recharge-verify-box {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fafafa;
    text-align: center;
}
.client-recharge-verify-box .verify-status {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: #666;
}
.client-recharge-verify-box .verify-status.is-waiting { color: #666; }
.client-recharge-verify-box .verify-status.is-pending { color: #c62828; font-weight: 600; }
.client-recharge-verify-box .verify-status.is-expired { color: #c62828; font-weight: 600; }
.client-recharge-result-banner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.client-recharge-result-banner.is-success { background: #e8f5e9; color: #2e7d4a; }
.client-recharge-result-banner.is-error { background: #fdecea; color: #c62828; }
.client-recharge-result-banner .icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: rgba(255,255,255,.7);
    flex-shrink: 0;
}
@media (max-width: 720px) {
    .client-recharge-balances {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .client-recharge-type-grid { grid-template-columns: 1fr; }
    .client-recharge-order-row {
        grid-template-columns: 72px minmax(0, 1fr) auto;
    }
    .client-recharge-amount-row { flex-wrap: wrap; }
    .client-topbar-balances { display: none; }
}
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-blue { background: #3498db; color: #fff; }
.btn-yellow { background: #f39c12; color: #fff; }
.btn-orange { background: #e67e22; color: #fff; }
.btn-purple { background: #9b59b6; color: #fff; }
.btn-gray { background: #95a5a6; color: #fff; }
.btn-white { background: #fff; color: #333; border: 1px solid #ddd; }

/* Cards */
.card { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.card-desc { color: #888; font-size: 13px; margin-bottom: 16px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-header h1 { font-size: 20px; font-weight: 600; }

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); border-left: 4px solid #008c5e; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: #333; }
.stat-card .stat-label { color: #888; font-size: 12px; margin-top: 4px; }
.stat-card.highlight-green .stat-value { color: #008c5e; }
.stat-card.highlight-orange .stat-value { color: #e67e22; }
.stat-card.highlight-red .stat-value { color: #e74c3c; }

/* Settings row */
.settings-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.settings-row select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; min-width: 180px; }

.locale-settings-card .card-title,
.locale-settings-card .card-desc { margin-bottom: 0; }
.locale-settings-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.locale-settings-head-text { flex: 1; min-width: 0; }
.locale-settings-head-text .card-desc { margin-top: 4px; }
.locale-settings-head-text .card-desc-sub { margin-top: 6px; margin-bottom: 0; color: #666; font-size: 12px; }
.locale-readonly-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.locale-readonly-item {
    padding: 8px 12px;
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 14px;
    color: #555;
}
.search-bar .filter-client,
.overview-filters .filter-client {
    min-width: 140px;
}
.col-owner-client,
.col-assign-client {
    white-space: nowrap;
    font-size: 13px;
    color: #444;
    min-width: 120px;
}
.product-assign-select,
.domain-assign-select {
    min-width: 120px;
    max-width: 160px;
}
.product-lock-badge {
    margin-left: 4px;
    font-size: 11px;
    vertical-align: middle;
}
.product-row-locked .product-cell-readonly {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: default;
}
.product-row-locked:hover { background: #fafafa; }
.admin-sound-toggle { flex-shrink: 0; white-space: nowrap; }
.admin-sound-toggle.is-on { border-color: #008c5e; color: #008c5e; background: #f0faf6; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
th { background: #fafafa; font-weight: 600; font-size: 13px; color: #555; white-space: nowrap; }
tr:hover { background: #fafafa; }
.product-table tbody tr.product-row { transition: background .15s ease; cursor: default; }
.product-table tbody tr.product-row:hover { background: #e8f8f0; }
.product-table .product-id-cell {
    width: 88px;
    font-weight: 600;
    font-size: 13px;
    color: #008c5e;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.product-cell-link { display: block; color: inherit; text-decoration: none; }
.product-cell-link:hover .product-title { color: #008c5e; }
.product-cell-link .product-thumb { transition: opacity .15s; }
.product-cell-link:hover .product-thumb { opacity: .85; }
.product-thumb { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; background: #eee; flex-shrink: 0; }
.product-thumb-empty { display: block; background: #eee; }
.product-thumb[hidden], .product-thumb-empty[hidden] { display: none !important; }
.product-cell { display: flex; align-items: center; gap: 10px; max-width: 320px; }
.product-title { font-size: 13px; line-height: 1.4; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.badge-green { background: #e8f8f0; color: #008c5e; }
.badge-orange { background: #fef3e2; color: #e67e22; }
.badge-red { background: #fde8e8; color: #e74c3c; }
.badge-gray { background: #f0f0f0; color: #888; }

.admin-tag-list { display: flex; flex-wrap: wrap; gap: 4px; max-width: 220px; }
.admin-tag-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    background: #eef2ff;
    color: #4338ca;
    text-decoration: none;
    line-height: 1.4;
}
.admin-tag-badge:hover { background: #e0e7ff; color: #3730a3; }
.admin-tag-badge-static { cursor: default; }
.admin-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #f8f9ff;
    border: 1px solid #e0e7ff;
    border-radius: 4px;
    padding-right: 2px;
}
.admin-tag-btn {
    border: none;
    background: transparent;
    color: #6366f1;
    font-size: 11px;
    line-height: 1;
    padding: 2px 4px;
    cursor: pointer;
    border-radius: 3px;
}
.admin-tag-btn:hover { background: #eef2ff; color: #4338ca; }
.admin-tag-btn-remove { color: #b91c1c; font-size: 13px; }
.admin-tag-btn-remove:hover { background: #fef2f2; color: #991b1b; }
.admin-tag-add {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}
.admin-tag-input {
    flex: 1;
    min-width: 0;
    max-width: 140px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}
.admin-tag-add-btn {
    border: 1px solid #ddd;
    background: #fff;
    color: #4338ca;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
}
.admin-tag-add-btn:hover { background: #eef2ff; border-color: #c7d2fe; }
.admin-tag-global-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 0;
    border-top: 1px solid #f0f0f0;
    margin-top: 12px;
}
.admin-tag-global-label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    margin-right: 4px;
}
.admin-tag-global-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #f8f9ff;
    border: 1px solid #e0e7ff;
    border-radius: 4px;
    padding-right: 2px;
}
.col-admin-tags { min-width: 180px; vertical-align: top; }

.list-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 16px 16px;
    border-top: 1px solid #f0f0f0;
}
.list-pagination-meta {
    font-size: 13px;
    color: #666;
}
.list-pagination-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.list-per-page {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
}
.list-per-page-select {
    min-width: 64px;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    color: #333;
}
.list-pagination-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}
.list-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 13px;
    text-decoration: none;
    line-height: 1;
}
.list-page-btn:hover { border-color: #008c5e; color: #008c5e; }
.list-page-btn.is-active {
    background: #008c5e;
    border-color: #008c5e;
    color: #fff;
    font-weight: 600;
}
.list-page-btn.is-disabled {
    opacity: 0.45;
    cursor: default;
}
.list-page-ellipsis {
    min-width: 24px;
    text-align: center;
    color: #888;
    font-size: 13px;
}
.client-suspended-banner {
    background: #fdecea;
    color: #c62828;
    text-align: center;
    padding: 10px 16px;
    font-size: 14px;
    border-bottom: 1px solid #f5c6cb;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 99;
}
.client-quota-banner {
    background: #fff8e6;
    color: #8a6d00;
    text-align: center;
    padding: 10px 16px;
    font-size: 13px;
    line-height: 1.5;
    border-bottom: 1px solid #ffe8a3;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 99;
}
.client-quota-banner-line + .client-quota-banner-line { margin-top: 4px; }
body[data-client-suspended="1"] .main-wrapper { margin-top: 40px; }
body[data-client-quota-warn="1"] .main-wrapper { margin-top: 40px; }
.client-stat-cell { line-height: 1.35; }
.client-stat-used { font-weight: 600; }
.client-stat-remain { font-size: 11px; color: #888; }
.client-stat-remain.is-low { color: #c62828; font-weight: 600; }
.badge-purple { background: #f3e8fd; color: #9b59b6; }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 2px solid #e8e8e8; margin-bottom: 16px; }
.tab { padding: 10px 20px; cursor: pointer; color: #666; font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab.active { color: #008c5e; border-bottom-color: #008c5e; font-weight: 600; }
.tab .count { color: #999; margin-left: 4px; }

/* Search bar */
.search-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.search-bar > input[type="text"] { flex: 1; min-width: 200px; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; }
.search-bar select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; }
.admin-date-filter { display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.admin-date-custom-range {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
}
.admin-date-custom-range[hidden],
.admin-date-custom-range:not(.is-visible) { display: none !important; }
.admin-date-custom-range.is-visible { display: inline-flex !important; }
.admin-date-custom-range input[type="date"],
.search-bar .admin-date-custom-range input[type="date"],
.filter-row-dates .admin-date-custom-range input[type="date"] {
    flex: 0 0 auto;
    min-width: 140px;
    width: 140px;
    max-width: 160px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    position: relative;
}
.admin-date-sep { color: #666; font-size: 13px; white-space: nowrap; }
.search-bar .admin-date-filter select,
.filter-row-dates .admin-date-filter select,
.recharge-records-filter .admin-date-filter select,
.recharge-filter-row .admin-date-filter select { flex: 0 0 auto; }
.search-bar .admin-date-filter select,
.search-bar .admin-date-custom-range input[type="date"],
.recharge-records-filter .admin-date-filter select,
.recharge-filter-row .admin-date-filter select {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}

/* Toggle switch */
.toggle { position: relative; width: 44px; height: 24px; display: inline-block; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #ccc; border-radius: 24px; transition: .3s; }
.toggle-slider:before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .3s; }
.toggle input:checked + .toggle-slider { background: #008c5e; }
.toggle input:checked + .toggle-slider:before { transform: translateX(20px); }

/* Action buttons group */
.action-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.action-btns-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }

/* Info banner */
.info-banner { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; border-radius: 8px; padding: 20px; margin-bottom: 20px; }
.info-banner h3 { margin-bottom: 12px; }
.info-banner ol { padding-left: 20px; line-height: 1.8; font-size: 13px; }
.info-banner .server-ip { float: right; font-size: 13px; opacity: .9; }

/* Chart */
.chart-container { position: relative; height: 300px; }

/* Pixel form */
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .form-group { flex: 1; min-width: 200px; margin-bottom: 0; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 8px; padding: 24px; width: 480px; max-width: 90vw; max-height: 80vh; overflow-y: auto; }
.modal h2 { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* Account modal */
.account-modal { width: 520px; padding: 0; overflow: hidden; }
.account-modal .modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.account-modal .modal-header h2 { margin: 0; font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; color: #999; cursor: pointer; line-height: 1; padding: 0 4px; }
.modal-close:hover { color: #333; }
.modal-tabs { display: flex; border-bottom: 1px solid #e8e8e8; padding: 0 24px; margin-top: 16px; }
.modal-tab { padding: 10px 16px; background: none; border: none; cursor: pointer; font-size: 14px; color: #666; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.modal-tab.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }
.modal-tab-panel { display: none; padding: 20px 24px 0; }
.modal-tab-panel.active { display: block; }
.account-modal .form-group { margin-bottom: 16px; }
.account-modal .form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 13px; }
.account-modal .form-group .required { color: #e74c3c; margin-left: 2px; }
.account-modal .form-group input { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.account-modal .form-group input:disabled { background: #f5f5f5; color: #666; cursor: not-allowed; }
.field-hint { display: block; margin-top: 4px; font-size: 12px; color: #e74c3c; }
.account-modal .modal-actions { padding: 16px 24px 20px; border-top: 1px solid #f0f0f0; margin-top: 0; }
.reauth-modal { width: 420px; max-width: 92vw; }
.reauth-modal-body { padding: 12px 24px 4px; }
.reauth-modal-desc { margin: 0 0 16px; font-size: 13px; color: #666; line-height: 1.5; }

/* Online indicator */
.online-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.online-dot.on { background: #008c5e; box-shadow: 0 0 6px #008c5e; }
.online-dot.off { background: #ccc; }

/* Toast */
.toast { position: fixed; top: 70px; right: 24px; background: #008c5e; color: #fff; padding: 12px 20px; border-radius: 6px; z-index: 300; opacity: 0; transition: opacity .3s; pointer-events: none; }
.toast.show { opacity: 1; }

/* Checkbox */
input[type="checkbox"] { width: 16px; height: 16px; accent-color: #008c5e; }

.order-link { color: #008c5e; font-weight: 500; text-decoration: none; }
.order-link:hover { text-decoration: underline; }

/* Orders list */
.orders-page .card {
    overflow: hidden;
}
.orders-page .orders-table-wrap {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
    z-index: 0;
    isolation: isolate;
    max-width: 100%;
}
.orders-page .orders-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}
.orders-page .orders-table th,
.orders-page .orders-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    font-size: 13px;
    width: auto;
}
.orders-page .orders-table th {
    background: #fafafa;
    font-weight: 600;
    font-size: 13px;
    color: #555;
    white-space: nowrap;
}
.orders-page .orders-table tbody tr:last-child td {
    border-bottom: none;
}
.orders-page .orders-table tbody tr:hover {
    background: #fafafa;
}
.orders-page .orders-table .col-check {
    width: 40px;
    text-align: center;
}
.orders-page .orders-table .col-actions {
    width: max-content;
    min-width: 120px;
    white-space: nowrap;
    text-align: center;
}
.orders-page .orders-table .col-actions .order-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: nowrap;
}
.orders-page .orders-table .col-actions .btn {
    white-space: nowrap;
}
.order-detail-modal {
    width: 560px;
    max-width: 92vw;
    padding: 0;
    overflow: hidden;
}
.order-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 24px 12px;
    border-bottom: 1px solid #f0f0f0;
}
.order-detail-head h2 {
    margin: 0;
    font-size: 17px;
}
.order-detail-sub {
    margin: 6px 0 0;
    font-size: 12px;
    color: #999;
}
.order-detail-body {
    padding: 16px 24px 24px;
    max-height: 70vh;
    overflow-y: auto;
}
.order-detail-loading,
.order-detail-error {
    padding: 24px 0;
    text-align: center;
    color: #888;
    font-size: 14px;
}
.order-detail-error {
    color: #e74c3c;
}
.order-detail-modal .detail-section {
    margin-bottom: 16px;
}
.order-detail-modal .detail-section-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
}
.order-detail-modal .detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    gap: 12px;
}
.order-detail-modal .detail-row:last-child {
    border-bottom: none;
}
.order-detail-modal .detail-label {
    flex: 0 0 88px;
    color: #888;
}
.order-detail-modal .detail-value {
    flex: 1;
    color: #222;
    text-align: right;
    word-break: break-word;
}
.order-detail-modal .detail-row-address .detail-value {
    text-align: right;
    white-space: pre-wrap;
    line-height: 1.5;
}
.order-detail-modal .modal-actions {
    padding: 16px 24px 20px;
    border-top: 1px solid #f0f0f0;
    margin-top: 0;
}
.orders-page .orders-table .col-customer {
    vertical-align: top;
    width: 160px;
    max-width: 180px;
    min-width: 120px;
}
.orders-page .customer-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.4;
    min-width: 0;
    max-width: 180px;
}
.orders-page .cell-lines {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.35;
}
.orders-page .cell-line.customer-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.orders-page .cell-line.customer-email,
.orders-page .cell-line.customer-phone {
    font-size: 12px;
    color: #999;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.orders-page .order-amount {
    font-weight: 700;
    color: #222;
    font-size: 13px;
    white-space: nowrap;
}
.orders-page .order-status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    background: #f0f0f0;
    color: #666;
}
.orders-page .order-time {
    color: #444;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.orders-page .orders-table td.col-order-no {
    line-height: 1.35;
    white-space: nowrap;
}
.orders-page .orders-table .order-no-value {
    color: #008c5e;
    font-weight: 500;
    display: inline;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-size: 9px;
    line-height: 1.35;
}
.orders-page .orders-table .order-deleted-badge {
    display: inline-block;
    margin-left: 6px;
    vertical-align: middle;
    font-size: 10px;
}
.orders-page .orders-table tbody tr.order-row-deleted {
    opacity: 0.72;
}
.orders-page .orders-table .col-product {
    min-width: 220px;
    max-width: 420px;
}
.orders-page .product-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    min-width: 0;
}
.orders-page .product-title {
    flex: 1;
    min-width: 0;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    font-size: 13px;
}

.header-actions { display: flex; gap: 8px; align-items: center; }

@media (max-width: 768px) {
    .sidebar { display: none; }
    .content { margin-left: 0; padding: 16px 12px 20px; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .topbar { padding: 0 12px; height: 52px; }
    .main-wrapper { margin-top: 52px; min-height: calc(100vh - 52px); }
    .welcome,
    .welcome-impersonating { display: none; }
    .logo-text { font-size: 15px; }
    .btn-topbar-recharge { padding: 6px 10px; font-size: 12px; }
    .topbar-right .btn-outline,
    .topbar-right .btn-danger { padding: 6px 10px; font-size: 12px; }
    .client-suspended-banner,
    .client-quota-banner { top: 52px; font-size: 13px; padding: 8px 12px; }
    body[data-client-suspended="1"] .main-wrapper,
    body[data-client-quota-warn="1"] .main-wrapper { margin-top: 88px; }
    .mobile-top-nav {
        display: flex;
        position: fixed;
        top: 52px;
        left: 0;
        right: 0;
        z-index: 90;
        background: #fff;
        border-bottom: 1px solid #e8e8e8;
        box-shadow: 0 1px 4px rgba(0,0,0,.06);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    body[data-client-suspended="1"] .mobile-top-nav,
    body[data-client-quota-warn="1"] .mobile-top-nav { top: 88px; }
    .main-wrapper--mobile-nav { margin-top: calc(52px + 46px); }
    body[data-client-suspended="1"] .main-wrapper--mobile-nav,
    body[data-client-quota-warn="1"] .main-wrapper--mobile-nav { margin-top: calc(88px + 46px); }
    .mobile-top-nav-item {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 46px;
        padding: 8px 6px;
        color: #555;
        font-size: 14px;
        font-weight: 500;
        border-bottom: 3px solid transparent;
        transition: color .2s, background .2s, border-color .2s;
    }
    .mobile-top-nav-label {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        line-height: 1.2;
    }
    .mobile-top-nav-item:hover { background: #f5f5f5; color: #008c5e; }
    .mobile-top-nav-item.active {
        color: #008c5e;
        font-weight: 600;
        border-bottom-color: #008c5e;
        background: #f0faf5;
    }
    .mobile-top-nav-item[data-has-badge="1"] .mobile-top-nav-label,
    .mobile-top-nav-item[data-has-badge="1"] .nav-badge { color: #e53935; }
    .mobile-top-nav--disabled .mobile-top-nav-item {
        pointer-events: none;
        opacity: 0.42;
    }
    .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .page-header h1 { font-size: 18px; }
}
