/* ============================================
   Kernel Pro — User Center v2
   ============================================ */

:root {
    --bg-base:      #0c0d12;
    --bg-elevated:  #13141c;
    --bg-card:      #181924;
    --bg-card-hover:#1e2030;
    --bg-input:     #1a1b26;
    --text-primary:   #e4e6ed;
    --text-secondary: #8b8fa4;
    --text-muted:     #555871;
    --border:       #222436;
    --border-hover: #2e3148;
    --accent:       #4f7cff;
    --accent-dim:   rgba(79,124,255,0.12);
    --accent-hover: #3d6af0;
    --green:  #34d399;
    --red:    #f87171;
    --amber:  #fbbf24;
    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --radius-pill: 100px;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.03);
    --shadow-float: 0 8px 32px rgba(0,0,0,0.5);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Noto Sans SC', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    font-size: 14px;
    letter-spacing: -0.011em;
}

/* ───── Top bar ───── */

.top-bar {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.btn-back {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.btn-back:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}
.top-bar .page-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* ───── Main ───── */

.main {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}

/* ───── User profile ───── */

.user-profile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}
.user-avatar {
    width: 48px; height: 48px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--bg-input);
    flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.user-email {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-level-badge {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: var(--accent-dim);
    color: var(--accent);
    letter-spacing: 0.02em;
}
.user-level-img {
    width: 44px; height: 44px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ───── Stats grid ───── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 8px;
    text-align: center;
    box-shadow: var(--shadow-card);
}
.stat-card.accent {
    border-color: rgba(79,124,255,0.25);
    background: linear-gradient(135deg, rgba(79,124,255,0.08) 0%, var(--bg-card) 100%);
}
.stat-num {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.stat-card.accent .stat-num { color: var(--accent); }
.stat-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 2px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ───── Chart ───── */

.chart-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
}
.chart-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
}
.bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 80px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.bar-i {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.bar-i .bar {
    width: 100%;
    max-width: 28px;
    max-height: 100%;
    background: var(--accent);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.3s var(--ease);
}
.bar-i .bl {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}
.bar-i .bv {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ───── Info card ───── */

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px 0;
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
}
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-row .label {
    color: var(--text-muted);
    font-weight: 500;
}
.info-row .val {
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* ───── Cancel account ───── */

.btn-cancel-account {
    display: block;
    width: 100%;
    padding: 12px 0;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--red);
    background: rgba(248,113,113,0.06);
    border: 1px solid rgba(248,113,113,0.15);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background 0.15s;
    font-family: inherit;
}
.btn-cancel-account:hover {
    background: rgba(248,113,113,0.12);
}

/* ───── Skeleton ───── */

.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--border) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease infinite;
    border-radius: 4px;
    color: transparent !important;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ───── Responsive ───── */

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 769px) {
    .main { padding: 24px 20px 60px; }
    .stat-num { font-size: 24px; }
}
