:root {
    --ml-primary: #bf9c56;
    --ml-primary-dark: #a88545;
    --ml-primary-light: #d4b67a;
    --ml-primary-very-light: #f8f4eb;
    --ml-sidebar-bg: #1a1a1a;
    --ml-sidebar-text: #e0e0e0;
    --ml-sidebar-hover: #2a2a2a;
    --ml-content-bg: #ffffff;
    --ml-card-bg: #ffffff;
    --ml-border: #e0e0e0;
    --ml-text-dark: #2c3e50;
    --ml-text-light: #6c757d;
}

/* Container chính - Full viewport height */
.ml-userpanel-container {
    min-height: 100vh;
    height: 100vh;
    background: linear-gradient(135deg, var(--ml-primary) 0%, var(--ml-primary-dark) 100%);
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Layout chính - Cố định kích thước */
.ml-userpanel-layout {
    display: flex;
    width: 95vw;
    max-width: 1600px;
    height: 90vh;
    max-height: 900px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.ml-userpanel-sidebar {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    background: var(--ml-sidebar-bg);
    color: var(--ml-sidebar-text);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* Sidebar Header - Cố định chiều cao */
.ml-sidebar-header {
    padding: 25px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    flex-shrink: 0;
}

.ml-user-avatar {
    width: 65px;
    height: 65px;
    margin: 0 auto 12px;
    background: linear-gradient(45deg, var(--ml-primary), var(--ml-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

    .ml-user-avatar i {
        font-size: 30px;
        color: white;
    }

.ml-user-info h6 {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: white;
}

.ml-user-server {
    font-size: 11px;
    color: var(--ml-primary-light);
    background: rgba(191, 156, 86, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
}

/* Sidebar Navigation - Có thể scroll */
.ml-sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

    .ml-sidebar-nav::-webkit-scrollbar {
        width: 6px;
    }

    .ml-sidebar-nav::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
    }

    .ml-sidebar-nav::-webkit-scrollbar-thumb {
        background: var(--ml-primary);
        border-radius: 3px;
    }

.ml-nav-section {
    margin-bottom: 25px;
}

.ml-section-title {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--ml-primary-light);
    padding: 0 20px 10px;
    margin: 0 0 5px 0;
    font-weight: 600;
    letter-spacing: 1.2px;
}

.ml-nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .ml-nav-links li {
        margin: 2px 0;
    }

.ml-nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--ml-sidebar-text);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
    font-size: 14px;
}

    .ml-nav-link:hover {
        background: var(--ml-sidebar-hover);
        color: white;
        border-left-color: var(--ml-primary);
        text-decoration: none;
    }

    .ml-nav-link.active {
        background: rgba(191, 156, 86, 0.15);
        color: var(--ml-primary-light);
        border-left-color: var(--ml-primary);
    }

.ml-nav-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

/* ===== CONTENT AREA ===== */
.ml-userpanel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--ml-content-bg);
    overflow: hidden;
}

/* Content Header - Cố định chiều cao */
.ml-content-header {
    background: #F9EAE0;
    padding: 18px 30px;
    border-bottom: 2px solid var(--ml-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    min-height: 65px;
}

.ml-breadcrumb {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
}

.ml-breadcrumb-item {
    color: var(--ml-text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

    .ml-breadcrumb-item:hover {
        color: var(--ml-primary);
        text-decoration: none;
    }

    .ml-breadcrumb-item.active {
        color: var(--ml-text-dark);
        font-weight: 600;
    }

.ml-breadcrumb-divider {
    margin: 0 10px;
    color: var(--ml-primary-light);
}

.ml-header-actions .ml-logout-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
}

/* Content Body - Có thể scroll */
.ml-content-body {
    flex: 1;
    padding: 25px 30px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f8f9fa;
}

    .ml-content-body::-webkit-scrollbar {
        width: 8px;
    }

    .ml-content-body::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    .ml-content-body::-webkit-scrollbar-thumb {
        background: var(--ml-primary);
        border-radius: 4px;
    }

        .ml-content-body::-webkit-scrollbar-thumb:hover {
            background: var(--ml-primary-dark);
        }

/* Welcome Section */
.ml-welcome-section {
    margin-bottom: 25px;
    padding: 20px 25px;
    background: var(--ml-primary-very-light);
    border-radius: 8px;
    border-left: 4px solid var(--ml-primary);
}

    .ml-welcome-section h4 {
        color: var(--ml-text-dark);
        margin-bottom: 8px;
        font-size: 20px;
        font-weight: 600;
    }

    .ml-welcome-section p {
        margin: 0;
        font-size: 14px;
    }

/* Cards */
.ml-content-card {
    border: 1px solid var(--ml-border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    height: 100%;
    background: white;
}

.ml-card-header {
    background: var(--ml-primary-very-light);
    border-bottom: 1px solid var(--ml-border);
    padding: 15px 20px;
}

    .ml-card-header h5 {
        color: var(--ml-text-dark);
        font-weight: 600;
        display: flex;
        align-items: center;
        font-size: 16px;
        margin: 0;
    }

/* Info Grid */
.ml-info-grid {
    display: grid;
    gap: 12px;
}

.ml-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

    .ml-info-item:last-child {
        border-bottom: none;
    }

.ml-info-label {
    font-weight: 600;
    color: var(--ml-text-dark);
    margin: 0;
    font-size: 14px;
}

.ml-info-value {
    color: var(--ml-text-light);
    font-weight: 500;
    font-size: 14px;
}

/* Silk Balance */
.ml-silk-balance {
    padding: 15px 0;
}

.ml-silk-icon {
    font-size: 42px;
    color: var(--ml-primary);
    margin-bottom: 10px;
}

.ml-silk-amount {
    color: var(--ml-primary);
    font-weight: 700;
    margin: 10px 0;
    font-size: 28px;
}

.ml-btn-primary {
    background: var(--ml-primary);
    border-color: var(--ml-primary);
    font-weight: 500;
}

    .ml-btn-primary:hover {
        background: var(--ml-primary-dark);
        border-color: var(--ml-primary-dark);
    }

/* Quick Stats */
.ml-quick-stats {
    display: grid;
    gap: 15px;
}

.ml-stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--ml-primary-very-light);
    border-radius: 8px;
    border-left: 3px solid var(--ml-primary);
}

.ml-stat-icon {
    font-size: 28px;
    color: var(--ml-primary);
}

.ml-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--ml-text-dark);
    line-height: 1;
}

.ml-stat-label {
    font-size: 13px;
    color: var(--ml-text-light);
    margin-top: 4px;
}

/* Character Cards */
.character-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

    .character-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    }

.character-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 3px solid #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}

.character-name {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.1rem;
}

.level-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* QR Code */
.qr-code-container {
    text-align: center;
    padding: 20px;
}

.qr-image {
    width: 200px;
    height: 200px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    margin: 0 auto;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .ml-userpanel-layout {
        width: 98vw;
        height: 95vh;
    }
}

@media (max-width: 992px) {
    .ml-userpanel-sidebar {
        width: 240px;
        min-width: 240px;
        max-width: 240px;
    }

    .ml-nav-link {
        padding: 10px 15px;
        font-size: 13px;
    }

    .ml-content-body {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .ml-userpanel-container {
        padding: 10px;
        height: auto;
        min-height: 100vh;
    }

    .ml-userpanel-layout {
        flex-direction: column;
        width: 100%;
        height: auto;
        min-height: 95vh;
        max-height: none;
    }

    .ml-userpanel-sidebar {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        max-height: 50vh;
    }

    .ml-content-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
        min-height: auto;
    }

    .ml-content-body {
        padding: 15px;
    }

    .ml-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .ml-welcome-section {
        padding: 15px 20px;
    }
}

@media (max-width: 576px) {
    .ml-userpanel-layout {
        border-radius: 0;
    }

    .ml-content-header {
        padding: 15px 20px;
    }

    .ml-sidebar-header {
        padding: 20px 15px;
    }

    .ml-user-avatar {
        width: 55px;
        height: 55px;
    }

        .ml-user-avatar i {
            font-size: 26px;
        }
}
